]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
indenting
[chaz/openbox] / openbox / client.c
index c7d03a826fa61c28e8bbd9452178586b4df69cf5..e6265e93664226f5049f82660eb0d6c1ac317826 100644 (file)
@@ -401,6 +401,25 @@ void client_unmanage(ObClient *self)
        influence */
     screen_update_areas();
 
+    for (it = client_destructors; it; it = g_slist_next(it)) {
+        GDestroyNotify func = (GDestroyNotify) it->data;
+        func(self);
+    }
+        
+    if (focus_client == self) {
+        XEvent e;
+
+        /* focus the last focused window on the desktop, and ignore enter
+           events from the unmap so it doesnt mess with the focus */
+        while (XCheckTypedEvent(ob_display, EnterNotify, &e));
+        /* remove these flags so we don't end up getting focused in the
+           fallback! */
+        self->can_focus = FALSE;
+        self->focus_notify = FALSE;
+        self->modal = FALSE;
+        client_unfocus(self);
+    }
+
     /* tell our parent(s) that we're gone */
     if (self->transient_for == OB_TRAN_GROUP) { /* transient of group */
         GSList *it;
@@ -410,8 +429,8 @@ void client_unmanage(ObClient *self)
                 ((ObClient*)it->data)->transients =
                     g_slist_remove(((ObClient*)it->data)->transients, self);
     } else if (self->transient_for) {        /* transient of window */
-       self->transient_for->transients =
-           g_slist_remove(self->transient_for->transients, self);
+        self->transient_for->transients =
+            g_slist_remove(self->transient_for->transients, self);
     }
 
     /* tell our transients that we're gone */
@@ -422,20 +441,6 @@ void client_unmanage(ObClient *self)
         }
     }
 
-    for (it = client_destructors; it; it = g_slist_next(it)) {
-        GDestroyNotify func = (GDestroyNotify) it->data;
-        func(self);
-    }
-        
-    if (focus_client == self) {
-        XEvent e;
-
-        /* focus the last focused window on the desktop, and ignore enter
-           events from the unmap so it doesnt mess with the focus */
-        while (XCheckTypedEvent(ob_display, EnterNotify, &e));
-        client_unfocus(self);
-    }
-
     /* remove from its group */
     if (self->group) {
         group_remove(self->group, self);
@@ -2511,24 +2516,24 @@ gboolean client_can_focus(ObClient *self)
           (self->desktop == screen_desktop ||
            self->desktop == DESKTOP_ALL) &&
           !self->iconic))
-       return FALSE;
+        return FALSE;
 
     /* do a check to see if the window has already been unmapped or destroyed
        do this intelligently while watching out for unmaps we've generated
        (ignore_unmaps > 0) */
     if (XCheckTypedWindowEvent(ob_display, self->window,
-                              DestroyNotify, &ev)) {
-       XPutBackEvent(ob_display, &ev);
-       return FALSE;
+                               DestroyNotify, &ev)) {
+        XPutBackEvent(ob_display, &ev);
+        return FALSE;
     }
     while (XCheckTypedWindowEvent(ob_display, self->window,
-                                 UnmapNotify, &ev)) {
-       if (self->ignore_unmaps) {
-           self->ignore_unmaps--;
-       } else {
-           XPutBackEvent(ob_display, &ev);
-           return FALSE;
-       }
+                                  UnmapNotify, &ev)) {
+        if (self->ignore_unmaps) {
+            self->ignore_unmaps--;
+        } else {
+            XPutBackEvent(ob_display, &ev);
+            return FALSE;
+        }
     }
 
     return TRUE;
This page took 0.023569 seconds and 4 git commands to generate.