diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-03 10:07:07 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2012-08-03 10:07:07 -0400 |
commit | 4e304bf58fa28343289565a3b93efc96a15fd931 (patch) | |
tree | b068dab847a34df1c61d39a607f38b44c5d5ca0d | |
parent | de6fbaaec46412d3fdef0c01810182c0b01cafbd (diff) | |
download | eclipse.platform.swt-gtk_widget_get_window_.tar.gz eclipse.platform.swt-gtk_widget_get_window_.tar.xz eclipse.platform.swt-gtk_widget_get_window_.zip |
Use gtk_widget_get_window() instead of GTK_WIDGET_WINDOW in newer GTK+gtk_widget_get_window_
24 files changed, 147 insertions, 62 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java index 998cfa0685..5aec4a5379 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/org/eclipse/swt/awt/SWT_AWT.java @@ -202,7 +202,12 @@ public static Frame new_Frame (final Composite parent) { loadLibrary(); int /*long*/ awtHandle = getAWTHandle(window); if (awtHandle == 0) return; - int /*long*/ xWindow = OS.gdk_x11_drawable_get_xid(OS.GTK_WIDGET_WINDOW(OS.gtk_widget_get_toplevel(shell.handle))); + int /*long*/ xWindow; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + xWindow = OS.gdk_x11_drawable_get_xid(OS.gtk_widget_get_window(OS.gtk_widget_get_toplevel(shell.handle))); + } else { + xWindow = OS.gdk_x11_drawable_get_xid(OS.GTK_WIDGET_WINDOW(OS.gtk_widget_get_toplevel(shell.handle))); + } OS.XSetTransientForHint(OS.gdk_x11_display_get_xdisplay(OS.gdk_display_get_default()), awtHandle, xWindow); } }); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java index 92c38a3f7d..0499c3ea4e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java @@ -3462,7 +3462,12 @@ class AccessibleObject { } if (gtkAccessible.widget == 0) return; int /*long*/ topLevel = ATK.gtk_widget_get_toplevel (gtkAccessible.widget); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (topLevel); + int /*long*/ window; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + window = OS.gtk_widget_get_window (topLevel); + } else { + window = OS.GTK_WIDGET_WINDOW (topLevel); + } OS.gdk_window_get_origin (window, x, y); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java index c9cc25ade2..eeb43d3019 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java @@ -771,8 +771,12 @@ boolean setEventData(int /*long*/ context, int x, int y, int time, DNDEvent even } } if (dataTypes.length == 0) return false; - - int /*long*/ window = OS.GTK_WIDGET_WINDOW(control.handle); + int /*long*/ window; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + window = OS.gtk_widget_get_window (control.handle); + } else { + window = OS.GTK_WIDGET_WINDOW(control.handle); + } int [] origin_x = new int[1], origin_y = new int[1]; OS.gdk_window_get_origin(window, origin_x, origin_y); Point coordinates = new Point(origin_x[0] + x, origin_y[0] + y); diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java index af4b7a671f..4686202e84 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java @@ -104,7 +104,12 @@ public GLCanvas (Composite parent, int style, GLData data) { } glxAttrib [pos++] = 0; OS.gtk_widget_realize (handle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + window = OS.gtk_widget_get_window (handle); + } else { + window = OS.GTK_WIDGET_WINDOW (handle); + } int /*long*/ xDisplay = OS.gdk_x11_drawable_get_xdisplay (window); int /*long*/ infoPtr = GLX.glXChooseVisual (xDisplay, OS.XDefaultScreen (xDisplay), glxAttrib); if (infoPtr == 0) { @@ -156,7 +161,12 @@ public GLCanvas (Composite parent, int style, GLData data) { OS.gdk_window_resize (glWindow, clientArea.width, clientArea.height); break; case SWT.Dispose: - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + window = OS.gtk_widget_get_window (handle); + } else { + window = OS.GTK_WIDGET_WINDOW (handle); + } int /*long*/ xDisplay = OS.gdk_x11_drawable_get_xdisplay (window); if (context != 0) { if (GLX.glXGetCurrentContext () == context) { @@ -189,7 +199,12 @@ public GLCanvas (Composite parent, int style, GLData data) { */ public GLData getGLData () { checkWidget (); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + window = OS.gtk_widget_get_window (handle); + } else { + window = OS.GTK_WIDGET_WINDOW (handle); + } int /*long*/ xDisplay = OS.gdk_x11_drawable_get_xdisplay (window); GLData data = new GLData (); int [] value = new int [1]; 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 155872e3dd..cf8c805411 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 @@ -15506,6 +15506,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1toplevel) } #endif +#ifndef NO__1gtk_1widget_1get_1window +JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1window) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1window_FUNC); +/* + rc = (jintLong)gtk_widget_get_window(arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_window) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1window_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1widget_1grab_1focus JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1grab_1focus) (JNIEnv *env, jclass that, jintLong arg0) 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 f21e8ca75a..a9af801f23 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 @@ -198,6 +198,7 @@ #define gtk_widget_is_composited_LIB LIB_GTK #define gtk_widget_get_tooltip_text_LIB LIB_GTK #define gtk_widget_set_tooltip_text_LIB LIB_GTK +#define gtk_widget_get_window_LIB LIB_GTK #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 @@ -360,7 +361,11 @@ #define GTK_WIDGET_SET_HEIGHT(arg0, arg1) (arg0)->allocation.height = arg1 #define GTK_WIDGET_WIDTH(arg0) (arg0)->allocation.width #define GTK_WIDGET_SET_WIDTH(arg0, arg1) (arg0)->allocation.width = arg1 +#if GTK_CHECK_VERSION(2,14,0) +#define GTK_WIDGET_WINDOW(arg0) 0 +#else #define GTK_WIDGET_WINDOW(arg0) (arg0)->window +#endif #define GTK_WIDGET_X(arg0) (arg0)->allocation.x #define GTK_WIDGET_SET_X(arg0, arg1) (arg0)->allocation.x = arg1 #define GTK_ENTRY_IM_CONTEXT(arg0) (arg0)->im_context 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 b8074eb1de..ab7f02259b 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 = 1315; -int OS_nativeFunctionCallCount[1315]; +int OS_nativeFunctionCount = 1316; +int OS_nativeFunctionCallCount[1316]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -1232,6 +1232,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1widget_1get_1style", "_1gtk_1widget_1get_1tooltip_1text", "_1gtk_1widget_1get_1toplevel", + "_1gtk_1widget_1get_1window", "_1gtk_1widget_1grab_1focus", "_1gtk_1widget_1hide", "_1gtk_1widget_1is_1composited", 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 75194be58b..955a96456a 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 @@ -1240,6 +1240,7 @@ typedef enum { _1gtk_1widget_1get_1style_FUNC, _1gtk_1widget_1get_1tooltip_1text_FUNC, _1gtk_1widget_1get_1toplevel_FUNC, + _1gtk_1widget_1get_1window_FUNC, _1gtk_1widget_1grab_1focus_FUNC, _1gtk_1widget_1hide_FUNC, _1gtk_1widget_1is_1composited_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 0a5969cade..23dfb17923 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 @@ -12076,6 +12076,16 @@ public static final int gtk_widget_get_events(int /*long*/ widget) { lock.unlock(); } } +/** @method flags=dynamic */ +public static final native int /*long*/ _gtk_widget_get_window (int /*long*/ widget); +public static final int /*long*/ gtk_widget_get_window (int /*long*/ widget) { + lock.lock(); + try { + return _gtk_widget_get_window(widget); + } finally { + lock.unlock(); + } +} /** @param widget cast=(GtkWidget *) */ public static final native int /*long*/ _gtk_widget_get_modifier_style(int /*long*/ widget); public static final int /*long*/ gtk_widget_get_modifier_style(int /*long*/ widget) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index 5adc42c51e..7310bd2897 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -1413,7 +1413,7 @@ boolean isFocusHandle(int widget) { int /*long*/ paintWindow () { int /*long*/ childHandle = entryHandle != 0 ? entryHandle : handle; OS.gtk_widget_realize (childHandle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (childHandle); + int /*long*/ window = gtk_widget_get_window (childHandle); if ((style & SWT.READ_ONLY) != 0) return window; int /*long*/ children = OS.gdk_window_get_children (window); if (children != 0) window = OS.g_list_data (children); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java index 81445e9bd1..946acdb31c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java @@ -501,7 +501,7 @@ void fixTabList (Control control) { void fixZOrder () { if ((state & CANVAS) != 0) return; int /*long*/ parentHandle = parentingHandle (); - int /*long*/ parentWindow = OS.GTK_WIDGET_WINDOW (parentHandle); + int /*long*/ parentWindow = gtk_widget_get_window (parentHandle); if (parentWindow == 0) return; int /*long*/ [] userData = new int /*long*/ [1]; int /*long*/ windowList = OS.gdk_window_get_children (parentWindow); @@ -778,7 +778,7 @@ int /*long*/ gtk_map (int /*long*/ widget) { int /*long*/ gtk_realize (int /*long*/ widget) { int /*long*/ result = super.gtk_realize (widget); if ((style & SWT.NO_BACKGROUND) != 0) { - int /*long*/ window = OS.GTK_WIDGET_WINDOW (paintHandle ()); + int /*long*/ window = gtk_widget_get_window (paintHandle ()); if (window != 0) OS.gdk_window_set_back_pixmap (window, 0, false); } if (socketHandle != 0) { @@ -796,7 +796,7 @@ int /*long*/ gtk_scroll_child (int /*long*/ widget, int /*long*/ scrollType, int int /*long*/ gtk_style_set (int /*long*/ widget, int /*long*/ previousStyle) { int /*long*/ result = super.gtk_style_set (widget, previousStyle); if ((style & SWT.NO_BACKGROUND) != 0) { - int /*long*/ window = OS.GTK_WIDGET_WINDOW (paintHandle ()); + int /*long*/ window = gtk_widget_get_window (paintHandle ()); if (window != 0) OS.gdk_window_set_back_pixmap (window, 0, false); } return result; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index ed2c7673d2..04c12b766c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -157,7 +157,7 @@ void drawBackground (Control control, int /*long*/ window, int /*long*/ region, boolean drawGripper (int x, int y, int width, int height, boolean vertical) { int /*long*/ paintHandle = paintHandle (); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (paintHandle); + int /*long*/ window = gtk_widget_get_window (paintHandle); if (window == 0) return false; int orientation = vertical ? OS.GTK_ORIENTATION_HORIZONTAL : OS.GTK_ORIENTATION_VERTICAL; if ((style & SWT.MIRRORED) != 0) x = getClientWidth () - width - x; @@ -180,7 +180,7 @@ int /*long*/ eventHandle () { int /*long*/ eventWindow () { int /*long*/ eventHandle = eventHandle (); OS.gtk_widget_realize (eventHandle); - return OS.GTK_WIDGET_WINDOW (eventHandle); + return gtk_widget_get_window (eventHandle); } void fixFocus (Control focusControl) { @@ -360,7 +360,7 @@ int /*long*/ paintHandle () { int /*long*/ paintWindow () { int /*long*/ paintHandle = paintHandle (); OS.gtk_widget_realize (paintHandle); - return OS.GTK_WIDGET_WINDOW (paintHandle); + return gtk_widget_get_window (paintHandle); } /** @@ -386,7 +386,7 @@ public boolean print (GC gc) { if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); int /*long*/ topHandle = topHandle (); OS.gtk_widget_realize (topHandle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (topHandle); + int /*long*/ window = gtk_widget_get_window (topHandle); GCData data = gc.getGCData (); OS.gdk_window_process_updates (window, true); int /*long*/ drawable = data.drawable; @@ -399,7 +399,7 @@ void printWidget (GC gc, int /*long*/ drawable, int depth, int x, int y) { boolean obscured = (state & OBSCURED) != 0; state &= ~OBSCURED; int /*long*/ topHandle = topHandle (); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (topHandle); + int /*long*/ window = gtk_widget_get_window (topHandle); printWindow (true, this, gc, drawable, depth, window, x, y); if (obscured) state |= OBSCURED; } @@ -808,7 +808,7 @@ void modifyStyle (int /*long*/ handle, int /*long*/ style) { * has had a region set on it, the region is lost. The * fix is to set the region again. */ - if (region != null) OS.gdk_window_shape_combine_region (OS.GTK_WIDGET_WINDOW (topHandle ()), region.handle, 0, 0); + if (region != null) OS.gdk_window_shape_combine_region (gtk_widget_get_window (topHandle ()), region.handle, 0, 0); } void moveHandle (int x, int y) { @@ -1076,7 +1076,7 @@ public void setSize (Point size) { public void setRegion (Region region) { checkWidget (); if (region != null && region.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (topHandle ()); + int /*long*/ window = gtk_widget_get_window (topHandle ()); int /*long*/ shape_region = (region == null) ? 0 : region.handle; OS.gdk_window_shape_combine_region (window, shape_region, 0, 0); this.region = region; @@ -2314,7 +2314,7 @@ int /*long*/ fixedMapProc (int /*long*/ widget) { OS.g_list_free (widgetList); } if ((OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_NO_WINDOW) == 0) { - OS.gdk_window_show_unraised (OS.GTK_WIDGET_WINDOW (widget)); + OS.gdk_window_show_unraised (gtk_widget_get_window (widget)); } return 0; } @@ -3130,7 +3130,7 @@ int /*long*/ gtk_preedit_changed (int /*long*/ imcontext) { int /*long*/ gtk_realize (int /*long*/ widget) { int /*long*/ imHandle = imHandle (); if (imHandle != 0) { - int /*long*/ window = OS.GTK_WIDGET_WINDOW (paintHandle ()); + int /*long*/ window = gtk_widget_get_window (paintHandle ()); OS.gtk_im_context_set_client_window (imHandle, window); } if (backgroundImage != null) { @@ -3814,7 +3814,7 @@ public void setBackgroundImage (Image image) { } void setBackgroundPixmap (Image image) { - int /*long*/ window = OS.GTK_WIDGET_WINDOW (paintHandle ()); + int /*long*/ window = gtk_widget_get_window (paintHandle ()); if (window != 0) { if (image.pixmap != 0) { OS.gdk_window_set_back_pixmap (window, image.pixmap, false); @@ -3981,7 +3981,7 @@ public void setEnabled (boolean enabled) { if (!OS.GDK_WINDOWING_X11 ()) { OS.gdk_window_raise (enableWindow); } else { - restackWindow (enableWindow, OS.GTK_WIDGET_WINDOW (topHandle), true); + restackWindow (enableWindow, gtk_widget_get_window (topHandle), true); } if (OS.GTK_WIDGET_VISIBLE (topHandle)) OS.gdk_window_show_unraised (enableWindow); } @@ -4518,7 +4518,7 @@ void setZOrder (Control sibling, boolean above, boolean fixRelations, boolean fi int /*long*/ topHandle = topHandle (); int /*long*/ siblingHandle = sibling != null ? sibling.topHandle () : 0; - int /*long*/ window = OS.GTK_WIDGET_WINDOW (topHandle); + int /*long*/ window = gtk_widget_get_window (topHandle); if (window != 0) { int /*long*/ siblingWindow = 0; if (sibling != null) { 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 4631d4d3b5..d478017676 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 @@ -1011,7 +1011,12 @@ void createDisplay (DeviceData data) { OS.gdk_window_add_filter (0, filterProc, 0); if (OS.GDK_WINDOWING_X11 ()) { - int /*long*/ xWindow = OS.gdk_x11_drawable_get_xid (OS.GTK_WIDGET_WINDOW (shellHandle)); + int /*long*/ xWindow; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + xWindow = OS.gdk_x11_drawable_get_xid (OS.gtk_widget_get_window (shellHandle)); + } else { + xWindow = OS.gdk_x11_drawable_get_xid (OS.GTK_WIDGET_WINDOW (shellHandle)); + } byte[] atomName = Converter.wcsToMbcs (null, "SWT_Window_" + APP_NAME, true); //$NON-NLS-1$ int /*long*/ atom = OS.XInternAtom (xDisplay, atomName, false); OS.XSetSelectionOwner (xDisplay, atom, xWindow, OS.CurrentTime); @@ -4220,7 +4225,12 @@ int /*long*/ signalProc (int /*long*/ gobject, int /*long*/ arg1, int /*long*/ u byte[] name = Converter.wcsToMbcs (null, "org.eclipse.swt.filePath.message", true); //$NON-NLS-1$ int /*long*/ atom = OS.gdk_x11_atom_to_xatom (OS.gdk_atom_intern (name, true)); if (atom == OS.gdk_x11_atom_to_xatom (gdkEvent.atom)) { - int /*long*/ xWindow = OS.gdk_x11_drawable_get_xid (OS.GTK_WIDGET_WINDOW( shellHandle)); + int /*long*/ xWindow; + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + xWindow = OS.gdk_x11_drawable_get_xid (OS.gtk_widget_get_window( shellHandle)); + } else { + xWindow = OS.gdk_x11_drawable_get_xid (OS.GTK_WIDGET_WINDOW( shellHandle)); + } int /*long*/ [] type = new int /*long*/ [1]; int [] format = new int [1]; int [] nitems = new int [1]; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java index 8bd103943e..75e93fd73c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java @@ -375,7 +375,7 @@ void fixMenus (Decorations newParent) { if (!OS.GTK_WIDGET_MAPPED (handle)) { return new Rectangle (0, 0, 0, 0); } - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window = gtk_widget_get_window (handle); int [] origin_x = new int [1], origin_y = new int [1]; OS.gdk_window_get_origin (window, origin_x, origin_y); int x = origin_x [0] + OS.GTK_WIDGET_X (handle); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java index 34f8213b7c..96a7f0baa8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java @@ -145,7 +145,7 @@ void createHandle (int index) { void drawBand (int x, int y, int width, int height) { if ((style & SWT.SMOOTH) != 0) return; //TODO: Use Cairo - int /*long*/ window = OS.GTK_WIDGET_WINDOW (parent.paintHandle()); + int /*long*/ window = gtk_widget_get_window (parent.paintHandle()); if (window == 0) return; byte [] bits = {-86, 85, -86, 85, -86, 85, -86, 85}; int /*long*/ stipplePixmap = OS.gdk_bitmap_create_from_data (window, bits, 8, 8); @@ -172,7 +172,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ eventPtr) if (button != 1) return 0; if (gdkEvent.type == OS.GDK_2BUTTON_PRESS) return 0; if (gdkEvent.type == OS.GDK_3BUTTON_PRESS) return 0; - int /*long*/ window = OS.GTK_WIDGET_WINDOW (widget); + int /*long*/ window = gtk_widget_get_window (widget); int [] origin_x = new int [1], origin_y = new int [1]; OS.gdk_window_get_origin (window, origin_x, origin_y); startX = (int) (gdkEvent.x_root - origin_x [0]); @@ -287,7 +287,7 @@ int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ eventPtr) { if (newX == lastX && newY == lastY) return result; /* Ensure that the pointer image does not change */ - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window = gtk_widget_get_window (handle); int grabMask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_RELEASE_MASK; int /*long*/ gdkCursor = cursor != null ? cursor.handle : defaultCursor; int ptrGrabResult = OS.gdk_pointer_grab (window, false, grabMask, window, gdkCursor, OS.GDK_CURRENT_TIME); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java index 77cc837b35..8699da5813 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java @@ -355,11 +355,11 @@ public Rectangle getThumbBounds () { } Rectangle rect = new Rectangle(x, y, width, height); int [] origin_x = new int [1], origin_y = new int [1]; - int /*long*/ window = OS.GTK_WIDGET_WINDOW (parent.scrolledHandle); + int /*long*/ window = gtk_widget_get_window (parent.scrolledHandle); if (window != 0) OS.gdk_window_get_origin (window, origin_x, origin_y); rect.x += origin_x [0]; rect.y += origin_y [0]; - window = OS.GTK_WIDGET_WINDOW (parent.handle); + window = gtk_widget_get_window (parent.handle); if (window != 0) OS.gdk_window_get_origin (window, origin_x, origin_y); rect.x -= origin_x [0]; rect.y -= origin_y [0]; @@ -416,11 +416,11 @@ public Rectangle getThumbTrackBounds () { } Rectangle rect = new Rectangle(x, y, width, height); int [] origin_x = new int [1], origin_y = new int [1]; - int /*long*/ window = OS.GTK_WIDGET_WINDOW (parent.scrolledHandle); + int /*long*/ window = gtk_widget_get_window (parent.scrolledHandle); if (window != 0) OS.gdk_window_get_origin (window, origin_x, origin_y); rect.x += origin_x [0]; rect.y += origin_y [0]; - window = OS.GTK_WIDGET_WINDOW (parent.handle); + window = gtk_widget_get_window (parent.handle); if (window != 0) OS.gdk_window_get_origin (window, origin_x, origin_y); rect.x -= origin_x [0]; rect.y -= origin_y [0]; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java index 5f63d5d518..6a4c8a773f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java @@ -361,7 +361,7 @@ void redrawWidget (int x, int y, int width, int height, boolean redrawAll, boole if (!trim) return; int /*long*/ topHandle = topHandle (), paintHandle = paintHandle (); if (topHandle == paintHandle) return; - int /*long*/ window = OS.GTK_WIDGET_WINDOW (topHandle); + int /*long*/ window = gtk_widget_get_window (topHandle); GdkRectangle rect = new GdkRectangle (); if (redrawAll) { rect.width = OS.GTK_WIDGET_WIDTH (topHandle); 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 deed81c947..38f6532766 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 @@ -453,7 +453,7 @@ void adjustTrim () { if (display.ignoreTrim) return; int width = OS.GTK_WIDGET_WIDTH (shellHandle); int height = OS.GTK_WIDGET_HEIGHT (shellHandle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle); + int /*long*/ window = gtk_widget_get_window (shellHandle); GdkRectangle rect = new GdkRectangle (); OS.gdk_window_get_frame_extents (window, rect); int trimWidth = Math.max (0, rect.width - width); @@ -536,7 +536,7 @@ void bringToTop (boolean force) { * window. The fix is to use XSetInputFocus() to force * the focus. */ - int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle); + int /*long*/ window = gtk_widget_get_window (shellHandle); if ((xFocus || (style & SWT.ON_TOP) != 0) && OS.GDK_WINDOWING_X11 ()) { int /*long*/ xDisplay = OS.gdk_x11_drawable_get_xdisplay (window); int /*long*/ xWindow = OS.gdk_x11_drawable_get_xid (window); @@ -731,7 +731,7 @@ int /*long*/ filterProc (int /*long*/ xEvent, int /*long*/ gdkEvent, int /*long* sendEvent (SWT.Activate); if (isDisposed ()) return 0; if (isCustomResize ()) { - OS.gdk_window_invalidate_rect (OS.GTK_WIDGET_WINDOW (shellHandle), null, false); + OS.gdk_window_invalidate_rect (gtk_widget_get_window (shellHandle), null, false); } break; } @@ -754,8 +754,9 @@ int /*long*/ filterProc (int /*long*/ xEvent, int /*long*/ gdkEvent, int /*long* display.activePending = false; } if (isDisposed ()) return 0; - if (isCustomResize ()) { - OS.gdk_window_invalidate_rect (OS.GTK_WIDGET_WINDOW (shellHandle), null, false); + if (isCustomResize ()) { + OS.gdk_window_invalidate_rect (gtk_widget_get_window (shellHandle), null, false); + } break; } @@ -808,7 +809,7 @@ void hookEvents () { OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [MAP_EVENT], 0, display.shellMapProcClosure, false); OS.g_signal_connect_closure_by_id (shellHandle, display.signalIds [ENTER_NOTIFY_EVENT], 0, display.closures [ENTER_NOTIFY_EVENT], false); OS.g_signal_connect_closure (shellHandle, OS.move_focus, display.closures [MOVE_FOCUS], false); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle); + int /*long*/ window = gtk_widget_get_window (shellHandle); OS.gdk_window_add_filter (window, display.filterProc, shellHandle); if (isCustomResize ()) { int mask = OS.GDK_POINTER_MOTION_MASK | OS.GDK_BUTTON_RELEASE_MASK | OS.GDK_BUTTON_PRESS_MASK | OS.GDK_ENTER_NOTIFY_MASK | OS.GDK_LEAVE_NOTIFY_MASK; @@ -1205,7 +1206,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ event) { GdkEventExpose gdkEventExpose = new GdkEventExpose (); OS.memmove (gdkEventExpose, event, GdkEventExpose.sizeof); int /*long*/ style = OS.gtk_widget_get_style (widget); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (widget); + int /*long*/ window = gtk_widget_get_window (widget); int [] width = new int [1]; int [] height = new int [1]; OS.gdk_drawable_get_size (window, width, height); @@ -1252,7 +1253,7 @@ int /*long*/ gtk_leave_notify_event (int /*long*/ widget, int /*long*/ event) { GdkEventCrossing gdkEvent = new GdkEventCrossing (); OS.memmove (gdkEvent, event, GdkEventCrossing.sizeof); if ((gdkEvent.state & OS.GDK_BUTTON1_MASK) == 0) { - int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle); + int /*long*/ window = gtk_widget_get_window (shellHandle); OS.gdk_window_set_cursor (window, 0); display.resizeMode = 0; } @@ -1324,14 +1325,14 @@ int /*long*/ gtk_motion_notify_event (int /*long*/ widget, int /*long*/ event) { break; } if (x != display.resizeBoundsX || y != display.resizeBoundsY) { - OS.gdk_window_move_resize (OS.GTK_WIDGET_WINDOW (shellHandle), x, y, width, height); + OS.gdk_window_move_resize (gtk_widget_get_window (shellHandle), x, y, width, height); } else { OS.gtk_window_resize (shellHandle, width, height); } } else { int mode = getResizeMode (gdkEvent.x, gdkEvent.y); if (mode != display.resizeMode) { - int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle); + int /*long*/ window = gtk_widget_get_window (shellHandle); int /*long*/ cursor = OS.gdk_cursor_new (mode); OS.gdk_window_set_cursor (window, cursor); OS.gdk_cursor_unref (cursor); @@ -1389,7 +1390,7 @@ int /*long*/ gtk_size_allocate (int /*long*/ widget, int /*long*/ allocation) { int /*long*/ gtk_realize (int /*long*/ widget) { int /*long*/ result = super.gtk_realize (widget); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle); + int /*long*/ window = gtk_widget_get_window (shellHandle); if ((style & SWT.SHELL_TRIM) != SWT.SHELL_TRIM) { int decorations = 0; if ((style & SWT.NO_TRIM) == 0) { @@ -1724,7 +1725,7 @@ public void setEnabled (boolean enabled) { } else { int /*long*/ parentHandle = shellHandle; OS.gtk_widget_realize (parentHandle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (parentHandle); + int /*long*/ window = gtk_widget_get_window (parentHandle); Rectangle rect = getBounds (); GdkWindowAttr attributes = new GdkWindowAttr (); attributes.width = rect.width; @@ -2380,7 +2381,7 @@ void releaseWidget () { tooltipsHandle = 0; if (group != 0) OS.g_object_unref (group); group = modalGroup = 0; - int /*long*/ window = OS.GTK_WIDGET_WINDOW (shellHandle); + int /*long*/ window = gtk_widget_get_window (shellHandle); OS.gdk_window_remove_filter(window, display.filterProc, shellHandle); lastActive = null; } @@ -2415,7 +2416,7 @@ void setToolTipText (int /*long*/ rootWidget, int /*long*/ tipWidget, String str * contain the proper x and y coordinates. */ int /*long*/ eventPtr = 0; - int /*long*/ tipWindow = OS.GTK_WIDGET_WINDOW (rootWidget); + int /*long*/ tipWindow = gtk_widget_get_window (rootWidget); if (tipWindow != 0) { int [] x = new int [1], y = new int [1]; int /*long*/ window = OS.gdk_window_at_pointer (x, y); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index 74bea0bb9b..1cc78e26bb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -1119,7 +1119,7 @@ public Rectangle getClientArea () { checkWidget (); forceResize (); OS.gtk_widget_realize (handle); - int /*long*/ fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle); + int /*long*/ fixedWindow = gtk_widget_get_window (fixedHandle); int /*long*/ binWindow = OS.gtk_tree_view_get_bin_window (handle); int [] binX = new int [1], binY = new int [1]; OS.gdk_window_get_origin (binWindow, binX, binY); @@ -1357,7 +1357,7 @@ public int getHeaderHeight () { return height; } OS.gtk_widget_realize (handle); - int /*long*/ fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle); + int /*long*/ fixedWindow = gtk_widget_get_window (fixedHandle); int /*long*/ binWindow = OS.gtk_tree_view_get_bin_window (handle); int [] binY = new int [1]; OS.gdk_window_get_origin (binWindow, null, binY); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java index c7da6c4393..456c897bb6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java @@ -137,7 +137,7 @@ public void addSelectionListener (SelectionListener listener) { void configure () { int /*long*/ screen = OS.gdk_screen_get_default (); OS.gtk_widget_realize (handle); - int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, OS.GTK_WIDGET_WINDOW (handle)); + int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (handle)); GdkRectangle dest = new GdkRectangle (); OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest); Point point = getSize (dest.width / 4); @@ -251,7 +251,7 @@ void configure () { } int /*long*/ rgn = OS.gdk_region_polygon (polyline, polyline.length / 2, OS.GDK_EVEN_ODD_RULE); OS.gtk_widget_realize (handle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window = gtk_widget_get_window (handle); OS.gdk_window_shape_combine_region (window, rgn, 0, 0); OS.gdk_region_destroy (rgn); } @@ -340,7 +340,7 @@ Point getLocation () { y = area.y + area.height / 2; } else { OS.gtk_widget_realize (itemHandle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (itemHandle); + int /*long*/ window = gtk_widget_get_window (itemHandle); int [] px = new int [1], py = new int [1]; OS.gdk_window_get_origin (window, px, py); x = px [0] + OS.GTK_WIDGET_WIDTH (itemHandle) / 2; @@ -472,7 +472,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ eventPtr) { if ((state & OBSCURED) != 0) return 0; - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window = gtk_widget_get_window (handle); int x = BORDER + PADDING; int y = BORDER + PADDING; if (OS.USE_CAIRO) { @@ -579,7 +579,7 @@ int /*long*/ gtk_size_allocate (int /*long*/ widget, int /*long*/ allocation) { int y = point.y; int /*long*/ screen = OS.gdk_screen_get_default (); OS.gtk_widget_realize (widget); - int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, OS.GTK_WIDGET_WINDOW (widget)); + int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget)); GdkRectangle dest = new GdkRectangle (); OS.gdk_screen_get_monitor_geometry (screen, monitorNumber, dest); int w = OS.GTK_WIDGET_WIDTH (widget); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java index 812ce787bc..af86c4f365 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java @@ -308,7 +308,7 @@ Rectangle [] computeProportions (Rectangle [] rects) { void drawRectangles (Rectangle [] rects) { int /*long*/ window = OS.gdk_get_default_root_window(); if (parent != null) { - window = OS.GTK_WIDGET_WINDOW (parent.paintHandle()); + window = gtk_widget_get_window (parent.paintHandle()); } if (window == 0) return; //TODO: Use Cairo @@ -664,7 +664,7 @@ public boolean open () { checkWidget(); window = OS.gdk_get_default_root_window(); if (parent != null) { - window = OS.GTK_WIDGET_WINDOW (parent.paintHandle()); + window = gtk_widget_get_window (parent.paintHandle()); } if (window == 0) return false; cancelled = false; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java index 2a82fb8e45..b02a977fe1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TrayItem.java @@ -339,7 +339,7 @@ int /*long*/ gtk_size_allocate (int /*long*/ widget, int /*long*/ allocation) { } } OS.gtk_widget_realize (handle); - int /*long*/ window = OS.GTK_WIDGET_WINDOW (handle); + int /*long*/ window = gtk_widget_get_window (handle); OS.gdk_window_shape_combine_region (window, region.handle, 0, 0); region.dispose (); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index e49ef7abc4..10fe5ee870 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -1120,7 +1120,7 @@ public Rectangle getClientArea () { checkWidget (); forceResize (); OS.gtk_widget_realize (handle); - int /*long*/ fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle); + int /*long*/ fixedWindow = gtk_widget_get_window (fixedHandle); int /*long*/ binWindow = OS.gtk_tree_view_get_bin_window (handle); int [] binX = new int [1], binY = new int [1]; OS.gdk_window_get_origin (binWindow, binX, binY); @@ -1368,7 +1368,7 @@ public int getHeaderHeight () { return height; } OS.gtk_widget_realize (handle); - int /*long*/ fixedWindow = OS.GTK_WIDGET_WINDOW (fixedHandle); + int /*long*/ fixedWindow = gtk_widget_get_window (fixedHandle); int /*long*/ binWindow = OS.gtk_tree_view_get_bin_window (handle); int [] binY = new int [1]; OS.gdk_window_get_origin (binWindow, null, binY); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index eb3bbcd8c5..261b3c7535 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -1674,6 +1674,14 @@ int /*long*/ sizeRequestProc (int /*long*/ handle, int /*long*/ arg0, int /*long return 0; } +int /*long*/ gtk_widget_get_window (int /*long*/ widget){ + if (OS.GTK_VERSION >= OS.VERSION(2, 14, 0)){ + return OS.gtk_widget_get_window (widget); + } else { + return OS.GTK_WIDGET_WINDOW (widget); + } +} + /** * Returns a string containing a concise, human-readable * description of the receiver. |