changeset 35636:840e473ba4c0

Restore GUI's X error handler after gtk_init(). GDK sets its own handler.
author ib
date Thu, 10 Jan 2013 15:40:43 +0000
parents ac2a7944829c
children 58d55c933757
files gui/dialog/dialog.c gui/wm/ws.c gui/wm/ws.h
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/dialog.c	Thu Jan 10 15:24:39 2013 +0000
+++ b/gui/dialog/dialog.c	Thu Jan 10 15:40:43 2013 +0000
@@ -137,6 +137,7 @@
 #endif
 
     gtk_init(&argc, &argv);
+    wsSetErrorHandler();           // GDK has just set its own handler
 
     theme = gtk_icon_theme_get_default();
 
--- a/gui/wm/ws.c	Thu Jan 10 15:24:39 2013 +0000
+++ b/gui/wm/ws.c	Thu Jan 10 15:40:43 2013 +0000
@@ -249,6 +249,14 @@
     }
 }
 
+/**
+ * @brief Set the X error handler.
+ */
+void wsSetErrorHandler(void)
+{
+    XSetErrorHandler(wsErrorHandler);
+}
+
 void wsXInit(Display *display)
 {
     int eventbase;
@@ -258,7 +266,7 @@
 
     wsDisplay = display;
 
-    XSetErrorHandler(wsErrorHandler);
+    wsSetErrorHandler();
 
 /* enable DND atoms */
     wsXDNDInitialize();
--- a/gui/wm/ws.h	Thu Jan 10 15:24:39 2013 +0000
+++ b/gui/wm/ws.h	Thu Jan 10 15:40:43 2013 +0000
@@ -214,6 +214,7 @@
 
 void wsXDone(void);
 void wsXInit(Display *display);
+void wsSetErrorHandler(void);
 
 int wsGetDepthOnScreen(void);