diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT OpenGL')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java | 21 |
1 files changed, 18 insertions, 3 deletions
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]; |