]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
set the desktop hint when the window already has a hint but its out of range
[chaz/openbox] / openbox / client.c
index 87cdba96973d61b55cef4f8f76bcff33ea6bbcee..08c22a75082c4da5209986f5b4062b96b39e0cf4 100644 (file)
@@ -290,11 +290,11 @@ void client_manage(Window window)
 
     screen_update_struts();
 
+    dispatch_client(Event_Client_New, self, 0, 0);
+
     /* make sure the window is visible */
     client_move_onscreen(self);
 
-    dispatch_client(Event_Client_New, self, 0, 0);
-
     client_showhide(self);
 
     if (activate) client_activate(self);
@@ -587,12 +587,13 @@ static void client_get_area(Client *self)
 
 static void client_get_desktop(Client *self)
 {
-    guint32 d;
+    guint32 d = screen_num_desktops; /* an always-invalid value */
 
     if (PROP_GET32(self->window, net_wm_desktop, cardinal, &d)) {
        if (d >= screen_num_desktops && d != DESKTOP_ALL)
-           d = screen_num_desktops - 1;
-       self->desktop = d;
+           self->desktop = screen_num_desktops - 1;
+        else
+            self->desktop = d;
     } else { 
         gboolean trdesk = FALSE;
 
@@ -616,6 +617,8 @@ static void client_get_desktop(Client *self)
            /* defaults to the current desktop */
            self->desktop = screen_desktop;
 
+    }
+    if (self->desktop != d) {
         /* set the desktop hint, to make sure that it always exists */
         PROP_SET32(self->window, net_wm_desktop, cardinal, self->desktop);
     }
@@ -1504,8 +1507,11 @@ static void calc_recursive(Client *self, Client *orig, StackLayer l,
         calc_recursive(it->data, orig, l, raised ? raised : l != old);
 
     if (!raised && l != old)
-       if (orig->frame) /* only restack if the original window is managed */
-           stacking_raise(CLIENT_AS_WINDOW(self));
+       if (orig->frame) { /* only restack if the original window is managed */
+            /* XXX add_non_intrusive ever? */
+            stacking_remove(CLIENT_AS_WINDOW(self));
+            stacking_add(CLIENT_AS_WINDOW(self));
+        }
 }
 
 void client_calc_layer(Client *self)
This page took 0.023182 seconds and 4 git commands to generate.