summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-10-03 14:23:32 -0400
committerAlexander Kurtakov <akurtako@redhat.com>2012-10-04 23:33:27 +0300
commita4e8d53a7f3afac8a7698d325365123a4d399a8c (patch)
treef47b8817d355d4a33a2b226f8b44def62ff81e42 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
parentf595bd26249b063ab16f669e49ee726a84b4ab51 (diff)
downloadeclipse.platform.swt-a4e8d53a7f3afac8a7698d325365123a4d399a8c.tar.gz
eclipse.platform.swt-a4e8d53a7f3afac8a7698d325365123a4d399a8c.tar.xz
eclipse.platform.swt-a4e8d53a7f3afac8a7698d325365123a4d399a8c.zip
Use gdk_device_get_window_at_position instead of gdk_window_at_pointer
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index d8dac6457d..7e73baeea7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -2540,7 +2540,7 @@ void setToolTipText (long /*int*/ rootWidget, long /*int*/ tipWidget, String str
if (tipWindow != 0) {
if (gtk_widget_get_visible (tipWidget) || gtk_widget_get_realized (tipWidget)) {
int [] x = new int [1], y = new int [1];
- long /*int*/ window = OS.gdk_window_at_pointer (x, y);
+ long /*int*/ window = gdk_device_get_window_at_position (x, y);
if (window != 0) {
long /*int*/ [] user_data = new long /*int*/ [1];
OS.gdk_window_get_user_data (window, user_data);
@@ -2580,4 +2580,14 @@ void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, in
OS.gtk_paint_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
}
}
+long /*int*/ gdk_device_get_window_at_position (int[] win_x, int[] win_y) {
+ if (OS.GTK_VERSION >= OS.VERSION(3,0,0)) {
+ long /*int*/ display = OS.gdk_display_get_default ();
+ long /*int*/ device_manager = OS.gdk_display_get_device_manager (display);
+ long /*int*/ device = OS.gdk_device_manager_get_client_pointer (device_manager);
+ return OS.gdk_device_get_window_at_position (device, win_x, win_y);
+ } else {
+ return OS.gdk_window_at_pointer (win_x, win_y);
+ }
+}
}