summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT OpenGL
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 OpenGL
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 OpenGL')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java21
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];