]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
mouse and key bindings plugins work. segfault somewhere still on shutdown
[chaz/openbox] / openbox / client.c
index b9cebb79f1c4eef04c0ac08d670518182e5f520c..790dba5a859cf7e69ad762d09f8bab7fd215cab1 100644 (file)
@@ -5,6 +5,7 @@
 #include "frame.h"
 #include "engine.h"
 #include "event.h"
+#include "grab.h"
 #include "focus.h"
 #include "stacking.h"
 #include "dispatch.h"
@@ -120,9 +121,8 @@ void client_manage(Window window)
     XWindowAttributes attrib;
     XSetWindowAttributes attrib_set;
 /*    XWMHints *wmhint; */
-     
-    XGrabServer(ob_display);
-    XSync(ob_display, FALSE);
+
+    grab_server(TRUE);
 
     /* check if it has already been unmapped by the time we started mapping
        the grab does a sync so we don't have to here */
@@ -130,16 +130,14 @@ void client_manage(Window window)
        XCheckTypedWindowEvent(ob_display, window, UnmapNotify, &e)) {
        XPutBackEvent(ob_display, &e);
     
-       XUngrabServer(ob_display);
-       XFlush(ob_display);
+        grab_server(FALSE);
        return; /* don't manage it */
     }
 
     /* make sure it isn't an override-redirect window */
     if (!XGetWindowAttributes(ob_display, window, &attrib) ||
        attrib.override_redirect) {
-       XUngrabServer(ob_display);
-       XFlush(ob_display);
+        grab_server(FALSE);
        return; /* don't manage it */
     }
   
@@ -148,8 +146,7 @@ void client_manage(Window window)
        if ((wmhint->flags & StateHint) &&
            wmhint->initial_state == WithdrawnState) {
            /\* XXX: make dock apps work! *\/
-           XUngrabServer(ob_display);
-           XFlush(ob_display);
+            grab_server(FALSE);
            XFree(wmhint);
            return;
        }
@@ -184,8 +181,7 @@ void client_manage(Window window)
 
     client_apply_startup_state(client);
 
-    XUngrabServer(ob_display);
-    XFlush(ob_display);
+    grab_server(FALSE);
      
     client_list = g_slist_append(client_list, client);
     stacking_list = g_list_append(stacking_list, client);
@@ -1632,9 +1628,7 @@ void client_set_desktop(Client *self, guint target)
   
     g_message("Setting desktop %u\n", target);
 
-    if (!(target < screen_num_desktops ||
-         target == DESKTOP_ALL))
-       return;
+    g_assert(target < screen_num_desktops || target == DESKTOP_ALL);
 
     old = self->desktop;
     self->desktop = target;
This page took 0.022534 seconds and 4 git commands to generate.