diff --git a/gtk/src/gtk_2_3_compat.h b/gtk/src/gtk_2_3_compat.h index 1d3f680f..acef998b 100644 --- a/gtk/src/gtk_2_3_compat.h +++ b/gtk/src/gtk_2_3_compat.h @@ -30,6 +30,18 @@ #define GDK_IS_X11_DISPLAY(display) true #define gdk_x11_window_get_xid(window) GDK_WINDOW_XWINDOW (window) +inline void gdk_x11_display_error_trap_push(GdkDisplay *dpy) +{ + gdk_error_trap_push(); +} + +inline void gdk_x11_display_error_trap_pop_ignored(GdkDisplay *dpy) +{ + if (gdk_error_trap_pop()) + { + } +} + inline void gdk_window_get_geometry (GdkWindow *window, gint *x, gint *y, diff --git a/gtk/src/gtk_glx_context.cpp b/gtk/src/gtk_glx_context.cpp index 3a342182..7327ff41 100644 --- a/gtk/src/gtk_glx_context.cpp +++ b/gtk/src/gtk_glx_context.cpp @@ -75,7 +75,7 @@ bool GTKGLXContext::attach (GtkWidget *widget) return false; } fbconfig = fbconfigs[0]; - XFree (fbconfigs); + XFree(fbconfigs); vi = glXGetVisualFromFBConfig (display, fbconfig); @@ -107,10 +107,12 @@ bool GTKGLXContext::create_context () const char *extensions = glXQueryExtensionsString (display, screen); + gdk_x11_display_error_trap_push(gdk_display); if (strstr (extensions, "GLX_ARB_create_context")) context = glXCreateContextAttribsARB (display, fbconfig, NULL, True, context_attribs); if (!context) context = glXCreateNewContext (display, fbconfig, GLX_RGBA_TYPE, NULL, True); + gdk_x11_display_error_trap_pop_ignored(gdk_display); if (!context) {