]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
add to teh focus order before the call to change_state, since this can remove/add...
[chaz/openbox] / openbox / client.c
index c219d6071a754bb4bd494a6b8e0f206c98987674..2e71f279667ddcaa262e935940803bee395e8632 100644 (file)
@@ -269,6 +269,10 @@ void client_manage(Window window)
 
     sn_app_started(self->class);
 
+    /* update the focus lists, do this before the call to change_state or
+       it can end up in the list twice! */
+    focus_order_add_new(self);
+
     client_change_state(self);
 
     /* remove the client's border (and adjust re gravity) */
@@ -287,9 +291,6 @@ void client_manage(Window window)
 
     client_apply_startup_state(self);
 
-    /* update the focus lists */
-    focus_order_add_new(self);
-
     stacking_add(CLIENT_AS_WINDOW(self));
     client_restore_session_stacking(self);
 
@@ -714,22 +715,19 @@ static void client_get_all(ObClient *self)
     client_update_wmhints(self);
     client_get_startup_id(self);
     client_get_desktop(self);
-    client_get_state(self);
     client_get_shaped(self);
 
     client_get_mwm_hints(self);
     client_get_type(self);/* this can change the mwmhints for special cases */
 
+    client_get_state(self);
+
     {
         /* a couple type-based defaults for new windows */
 
         /* this makes sure that these windows appear on all desktops */
         if (self->type == OB_CLIENT_TYPE_DESKTOP)
             self->desktop = DESKTOP_ALL;
-
-        /* dock windows default to ABOVE */
-        if (self->type == OB_CLIENT_TYPE_DOCK && !self->below)
-            self->above = TRUE;
     }
 
     client_update_protocols(self);
@@ -857,7 +855,8 @@ static void client_get_state(ObClient *self)
 
             for (it = self->group->members; it; it = g_slist_next(it)) {
                 ObClient *c = it->data;
-                if (c != self && !client_search_transient(self, c))
+                if (c != self && !client_search_transient(self, c) &&
+                    client_normal(self) && client_normal(c))
                 {
                     layer = MAX(layer,
                                 (c->above ? 1 : (c->below ? -1 : 0)));
@@ -1762,7 +1761,7 @@ static ObStackingLayer calc_layer(ObClient *self)
     else if (self->type == OB_CLIENT_TYPE_DOCK) {
         if (self->above) l = OB_STACKING_LAYER_DOCK_ABOVE;
         else if (self->below) l = OB_STACKING_LAYER_DOCK_BELOW;
-        else l = OB_STACKING_LAYER_NORMAL;
+        else l = OB_STACKING_LAYER_DOCK_NORMAL;
     }
     else if (self->above) l = OB_STACKING_LAYER_ABOVE;
     else if (self->below) l = OB_STACKING_LAYER_BELOW;
@@ -2564,7 +2563,9 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2)
                 fullscreen = TRUE;
             } else if (state == prop_atoms.net_wm_state_above) {
                 self->above = TRUE;
+                self->below = FALSE;
             } else if (state == prop_atoms.net_wm_state_below) {
+                self->above = FALSE;
                 self->below = TRUE;
             } else if (state == prop_atoms.ob_wm_state_undecorated) {
                 undecorated = TRUE;
This page took 0.021546 seconds and 4 git commands to generate.