diff options
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rw-r--r-- | gtk/ScintillaGTK.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index ee01f52cd..f3be0b457 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -75,6 +75,10 @@ #define IS_WIDGET_VISIBLE(w) (GTK_WIDGET_VISIBLE(w)) #endif +#if GTK_CHECK_VERSION(2,22,0) +#define USE_CAIRO 1 +#endif + #ifdef _MSC_VER // Constant conditional expressions are because of GTK+ headers #pragma warning(disable: 4127) @@ -530,7 +534,6 @@ void ScintillaGTK::MainForAll(GtkContainer *container, gboolean include_internal gint ScintillaGTK::FocusInThis(GtkWidget *widget) { try { - GTK_WIDGET_SET_FLAGS(widget, GTK_HAS_FOCUS); SetFocusState(true); if (im_context != NULL) { gchar *str = NULL; @@ -561,7 +564,6 @@ gint ScintillaGTK::FocusIn(GtkWidget *widget, GdkEventFocus * /*event*/) { gint ScintillaGTK::FocusOutThis(GtkWidget *widget) { try { - GTK_WIDGET_UNSET_FLAGS(widget, GTK_HAS_FOCUS); SetFocusState(false); if (PWidget(wPreedit) != NULL) @@ -1982,6 +1984,7 @@ gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose) PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), str); pango_layout_set_attributes(layout, attrs); +#ifndef USE_CAIRO GdkGC *gc = gdk_gc_new(widget->window); GdkColor color[2] = { {0, 0x0000, 0x0000, 0x0000}, {0, 0xffff, 0xffff, 0xffff} @@ -1996,8 +1999,8 @@ gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose) gdk_gc_set_foreground(gc, color); gdk_gc_set_background(gc, color + 1); gdk_draw_layout(widget->window, gc, 0, 0, layout); - g_object_unref(gc); +#endif g_free(str); pango_attr_list_unref(attrs); g_object_unref(layout); |