diff options
author | Alexander Kurtakov | 2012-02-29 12:45:20 -0500 |
---|---|---|
committer | Silenio Quarti | 2012-03-05 17:30:26 -0500 |
commit | 716f2741149429ab03db74a38566b08f01a32112 (patch) | |
tree | c2e07d46ce3654afd8ea0553f270763518ef53bc | |
parent | 83c36a9989b48dc069a1a0344d41b3f8fb9304c2 (diff) | |
download | eclipse.platform.swt-716f2741149429ab03db74a38566b08f01a32112.zip eclipse.platform.swt-716f2741149429ab03db74a38566b08f01a32112.tar.gz eclipse.platform.swt-716f2741149429ab03db74a38566b08f01a32112.tar.xz |
Use gdk_x11_window_lookup_for_display for gtk 2.24 instead of
gdk_window_lookup.
gdk_window_lookup is deprecated since gtk 2.24 and removed in gtk 3.
6 files changed, 62 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index c6e8818..23bedb8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -7072,7 +7072,15 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1window_1lookup) { jintLong rc = 0; OS_NATIVE_ENTER(env, that, _1gdk_1window_1lookup_FUNC); +/* rc = (jintLong)gdk_window_lookup(arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gdk_window_lookup) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } OS_NATIVE_EXIT(env, that, _1gdk_1window_1lookup_FUNC); return rc; } @@ -7479,6 +7487,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1x11_1visual_1get_1xvisual) } #endif +#ifndef NO__1gdk_1x11_1window_1lookup_1for_1display +JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1x11_1window_1lookup_1for_1display) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1gdk_1x11_1window_1lookup_1for_1display_FUNC); +/* + rc = (jintLong)gdk_x11_window_lookup_for_display((GdkDisplay *)arg0, arg1); +*/ + { + OS_LOAD_FUNCTION(fp, gdk_x11_window_lookup_for_display) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GdkDisplay *, jintLong))fp)((GdkDisplay *)arg0, arg1); + } + } + OS_NATIVE_EXIT(env, that, _1gdk_1x11_1window_1lookup_1for_1display_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1accel_1group_1new JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1accel_1group_1new) (JNIEnv *env, jclass that) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h index ca24b57..1663f94 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h @@ -165,6 +165,7 @@ #define gtk_window_get_group_LIB LIB_GTK #define gtk_window_get_opacity_LIB LIB_GTK #define gdk_window_create_similar_surface_LIB LIB_GDK +#define gdk_window_lookup_LIB LIB_GDK #define gdk_window_restack_LIB LIB_GDK #define gdk_window_set_keep_above_LIB LIB_GDK #define gdk_window_set_accept_focus_LIB LIB_GDK @@ -176,6 +177,7 @@ #define gdk_pango_context_set_colormap_LIB LIB_GDK #define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK #define gdk_x11_screen_lookup_visual_LIB LIB_GDK +#define gdk_x11_window_lookup_for_display_LIB LIB_GDK #define gdk_threads_set_lock_functions_LIB LIB_GDK #define atk_object_add_relationship_LIB LIB_ATK diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index 208bb19..d116736 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -18,8 +18,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1378; -int OS_nativeFunctionCallCount[1378]; +int OS_nativeFunctionCount = 1379; +int OS_nativeFunctionCallCount[1379]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -611,6 +611,7 @@ char * OS_nativeFunctionNames[] = { "_1gdk_1x11_1screen_1get_1window_1manager_1name", "_1gdk_1x11_1screen_1lookup_1visual", "_1gdk_1x11_1visual_1get_1xvisual", + "_1gdk_1x11_1window_1lookup_1for_1display", "_1gtk_1accel_1group_1new", "_1gtk_1accel_1groups_1activate", "_1gtk_1accel_1label_1set_1accel_1widget", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index 050c8fb..203d33b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -619,6 +619,7 @@ typedef enum { _1gdk_1x11_1screen_1get_1window_1manager_1name_FUNC, _1gdk_1x11_1screen_1lookup_1visual_FUNC, _1gdk_1x11_1visual_1get_1xvisual_FUNC, + _1gdk_1x11_1window_1lookup_1for_1display_FUNC, _1gtk_1accel_1group_1new_FUNC, _1gtk_1accel_1groups_1activate_FUNC, _1gtk_1accel_1label_1set_1accel_1widget_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index a04247b..8beef85 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -1255,6 +1255,19 @@ public static final int /*long*/ gdk_x11_visual_get_xvisual(int /*long*/ visual) lock.unlock(); } } +/** + * @method flags=dynamic + * @param gdkdisplay cast=(GdkDisplay *) + */ +public static final native int /*long*/ _gdk_x11_window_lookup_for_display(int /*long*/ gdkdisplay, int /*long*/ xid); +public static final int /*long*/ gdk_x11_window_lookup_for_display(int /*long*/ gdkdisplay, int /*long*/ xid) { + lock.lock(); + try { + return _gdk_x11_window_lookup_for_display(gdkdisplay, xid); + } finally { + lock.unlock(); + } +} public static final native int /*long*/ _gdk_pixmap_foreign_new(int /*long*/ anid); public static final int /*long*/ gdk_pixmap_foreign_new(int /*long*/ anid) { lock.lock(); @@ -1264,6 +1277,9 @@ public static final int /*long*/ gdk_pixmap_foreign_new(int /*long*/ anid) { lock.unlock(); } } +/** + * @method flags=dynamic + */ public static final native int /*long*/ _gdk_window_lookup(int /*long*/ xid); public static final int /*long*/ gdk_window_lookup(int /*long*/ xid) { lock.lock(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java index f53ab7a..8be3a04 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java @@ -777,7 +777,12 @@ int /*long*/ checkIfEventProc (int /*long*/ display, int /*long*/ xEvent, int /* default: return 0; } - int /*long*/ window = OS.gdk_window_lookup (OS.X_EVENT_WINDOW (xEvent)); + int /*long*/ window = 0; + if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) { + window = OS.gdk_x11_window_lookup_for_display(OS.gdk_display_get_default(), OS.X_EVENT_WINDOW (xEvent)); + } else { + window = OS.gdk_window_lookup (OS.X_EVENT_WINDOW (xEvent)); + } if (window == 0) return 0; if (flushWindow != 0) { if (flushAll) { @@ -1426,7 +1431,12 @@ public Control getCursorControl () { } if ((xWindow = buffer [0]) != 0) { xParent = xWindow; - int /*long*/ gdkWindow = OS.gdk_window_lookup (xWindow); + int /*long*/ gdkWindow = 0; + if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) { + gdkWindow = OS.gdk_x11_window_lookup_for_display(OS.gdk_display_get_default(), xWindow); + } else { + gdkWindow = OS.gdk_window_lookup (xWindow); + } if (gdkWindow != 0) { OS.gdk_window_get_user_data (gdkWindow, user_data); if (user_data[0] != 0) handle = user_data[0]; |