]> Dogcows Code - chaz/openbox/commitdiff
use the xerror stuff to trap errors instead of dupliacted the effort here
authorDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 17:11:07 +0000 (17:11 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 17:11:07 +0000 (17:11 +0000)
openbox/screen.c

index a83c5710ea529f2b3ad7ab79c419c3effaea8251..90c874ac31ffa4265d33a62e2cc801fa00218b67 100644 (file)
@@ -53,30 +53,22 @@ static void sn_event_func(SnMonitorEvent *event, void *data);
 
 static void set_root_cursor();
 
-static gboolean running;
-static int another_running(Display *d, XErrorEvent *e)
-{
-    (void)d;(void)e;
-    g_message("A window manager is already running on screen %d",
-             ob_screen);
-    running = TRUE;
-    return -1;
-}
-
 gboolean screen_annex()
 {
-    XErrorHandler old;
     pid_t pid;
     int i, num_support;
     guint32 *supported;
 
-    running = FALSE;
-    old = XSetErrorHandler(another_running);
+    xerror_set_ignore(TRUE);
+    xerror_occured = FALSE;
     XSelectInput(ob_display, ob_root, ROOT_EVENTMASK);
-    XSync(ob_display, FALSE);
-    XSetErrorHandler(old);
-    if (running)
+    xerror_set_ignore(FALSE);
+    if (xerror_occured) {
+        g_message("A window manager is already running on screen %d",
+                  ob_screen);
        return FALSE;
+    }
+
 
     g_message("Managing screen %d", ob_screen);
 
This page took 0.026513 seconds and 4 git commands to generate.