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