summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-10-05 14:43:48 -0400
committerAlexander Kurtakov <akurtako@redhat.com>2012-10-05 22:08:46 +0300
commit077815f21f4c006f679f782063ec7af635ece7f2 (patch)
treea2d29b2f11e773f6a8a04d6151f0d4fad9bcb14f /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
parent62c688e769f9a74f3b48ecff0633da531ba422d6 (diff)
downloadeclipse.platform.swt-077815f21f4c006f679f782063ec7af635ece7f2.tar.gz
eclipse.platform.swt-077815f21f4c006f679f782063ec7af635ece7f2.tar.xz
eclipse.platform.swt-077815f21f4c006f679f782063ec7af635ece7f2.zip
Use gtk_render_focus instead of gtk_paint_focus for GTK+ 3
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index d1963ec87a..f2e4407cf3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -803,7 +803,7 @@ public void drawFocus(int x, int y, int width, int height) {
Cairo.cairo_restore(cairo);
return;
}
- OS.gtk_paint_focus(style, data.drawable, OS.GTK_STATE_NORMAL, null, data.device.shellHandle, new byte[1], x, y, width, height);
+ gtk_render_focus (style, data.drawable, OS.GTK_STATE_NORMAL, null, data.device.shellHandle, new byte[1], x, y, width, height);
}
/**
@@ -4204,4 +4204,20 @@ public String toString () {
return "GC {" + handle + "}";
}
+void gtk_render_focus (long /*int*/ style, long /*int*/ window, int state_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 2, 0)) {
+ long /*int*/ cairo = OS.gdk_cairo_create (window);
+ long /*int*/ context = OS.gtk_widget_get_style_context (style);
+ OS.gtk_style_context_save (context);
+ OS.gtk_style_context_set_state (context, OS.gtk_widget_get_state_flags (widget));
+ Cairo.cairo_save (cairo);
+ OS.gtk_render_focus(context, cairo, x, y, width, height);
+ Cairo.cairo_restore (cairo);
+ OS.gtk_style_context_restore (context);
+ Cairo.cairo_destroy(cairo);
+
+ } else {
+ OS.gtk_paint_focus (style, window, state_type, area, widget, detail, x, y, width, height);
+ }
+}
}