]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
remove the obconf stuff
[chaz/openbox] / openbox / client.c
index 05f9d0956b0e75924e4ca3a36b2f8d7fd6292d25..bc3c6f0d76bb17bca9646245b7035e333230e95d 100644 (file)
@@ -401,12 +401,22 @@ 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);
     }
 
@@ -419,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 */
@@ -431,11 +441,6 @@ void client_unmanage(ObClient *self)
         }
     }
 
-    for (it = client_destructors; it; it = g_slist_next(it)) {
-        GDestroyNotify func = (GDestroyNotify) it->data;
-        func(self);
-    }
-        
     /* remove from its group */
     if (self->group) {
         group_remove(self->group, self);
@@ -824,7 +829,7 @@ void client_update_transient_for(ObClient *self)
     ObClient *target = NULL;
 
     if (XGetTransientForHint(ob_display, self->window, &t)) {
-       self->transient = TRUE;
+        self->transient = TRUE;
         if (t != self->window) { /* cant be transient to itself! */
             target = g_hash_table_lookup(window_map, &t);
             /* if this happens then we need to check for it*/
@@ -840,14 +845,15 @@ void client_update_transient_for(ObClient *self)
                    group */
                 if (t == self->group->leader ||
                     t == None ||
-                    t == RootWindow(ob_display, ob_screen)) {
+                    t == RootWindow(ob_display, ob_screen))
+                {
                     /* window is a transient for its group! */
                     target = OB_TRAN_GROUP;
                 }
             }
         }
     } else
-       self->transient = FALSE;
+        self->transient = FALSE;
 
     /* if anything has changed... */
     if (target != self->transient_for) {
@@ -1278,6 +1284,18 @@ void client_update_wmhints(ObClient *self)
                 for (it = self->group->members; it; it = it->next)
                     self->transients = g_slist_remove(self->transients,
                                                       it->data);
+
+                /* remove myself from parents in the group */
+                if (self->transient_for == OB_TRAN_GROUP) {
+                    for (it = self->group->members; it; it = it->next) {
+                        ObClient *c = it->data;
+
+                        if (c != self && !c->transient_for)
+                            c->transients = g_slist_remove(c->transients,
+                                                           self);
+                    }
+                }
+
                 group_remove(self->group, self);
                 self->group = NULL;
             }
@@ -2511,24 +2529,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;
@@ -2809,6 +2827,8 @@ ObClient *client_search_top_transient(ObClient *self)
         } else {
             GSList *it;
 
+            g_assert(self->group);
+
             for (it = self->group->members; it; it = it->next) {
                 ObClient *c = it->data;
 
This page took 0.025463 seconds and 4 git commands to generate.