summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-03 10:07:07 -0400
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-08-06 17:49:12 +0530
commit31b7a613958123368d896ee9b0a636412f2a598b (patch)
tree8733974da7d036726370ceac33b28dad40240962 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
parent2c810dc09ebe584d949d1446e7fe61dd64fa3e80 (diff)
downloadeclipse.platform.swt-31b7a613958123368d896ee9b0a636412f2a598b.tar.gz
eclipse.platform.swt-31b7a613958123368d896ee9b0a636412f2a598b.tar.xz
eclipse.platform.swt-31b7a613958123368d896ee9b0a636412f2a598b.zip
Bug 386145 Use gtk_widget_get_window() instead of GTK_WIDGET_WINDOW in newer GTK+
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java14
1 files changed, 12 insertions, 2 deletions
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];