summaryrefslogtreecommitdiff
path: root/eel/eel-editable-label.c
diff options
context:
space:
mode:
Diffstat (limited to 'eel/eel-editable-label.c')
-rw-r--r--eel/eel-editable-label.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 7780fe7f..2c7ea7b0 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -37,6 +37,12 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+/* Some compatibility defines to let us build on both Gtk2 and Gtk3 */
+#if !GTK_CHECK_VERSION (3, 0, 0)
+#define cairo_region_t GdkRegion
+#define cairo_region_destroy gdk_region_destroy
+#endif
+
enum
{
MOVE_CURSOR,
@@ -1580,7 +1586,7 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, gint xoffset, gint yof
}
else /* Block cursor */
{
- GdkRegion *clip;
+ cairo_region_t *clip;
gdk_draw_rectangle (gtk_widget_get_window (widget), label->primary_cursor_gc, TRUE,
xoffset + PANGO_PIXELS (strong_pos.x),
@@ -1608,7 +1614,7 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, gint xoffset, gint yof
NULL);
gdk_gc_set_clip_region (label->primary_cursor_gc, NULL);
- gdk_region_destroy (clip);
+ cairo_region_destroy (clip);
}
}
}
@@ -1650,7 +1656,7 @@ eel_editable_label_expose (GtkWidget *widget,
{
gint range[2];
const char *text;
- GdkRegion *clip;
+ cairo_region_t *clip;
GtkStateType state;
range[0] = label->selection_anchor;
@@ -1695,7 +1701,7 @@ eel_editable_label_expose (GtkWidget *widget,
&style->base[state]);
gdk_gc_set_clip_region (style->black_gc, NULL);
- gdk_region_destroy (clip);
+ cairo_region_destroy (clip);
}
else if (gtk_widget_has_focus (widget))
eel_editable_label_draw_cursor (label, x, y);