X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fclient.c;h=08c22a75082c4da5209986f5b4062b96b39e0cf4;hb=da24f9156bdd4758fa803c73769d3dec0c5d2895;hp=20bcf06766f0cd6f3b96d704d7c5887d764f59a9;hpb=6dd3ee7271d1c90de8f516e32263f2da7caac4b3;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 20bcf067..08c22a75 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -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)