X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fstacking.c;h=72b7c03ba51856cf9b123326b38f429ffc1692aa;hb=76943cdfe07390b031ad6404dbb59413364a5a17;hp=be6d07d6daaa0d0a590da95eb97c5ebb18d0615b;hpb=88097ba46cf4003f62effdc8b3aea64cdce6479f;p=chaz%2Fopenbox diff --git a/openbox/stacking.c b/openbox/stacking.c index be6d07d6..72b7c03b 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -13,12 +13,18 @@ void stacking_set_list() GList *it; guint size = g_list_length(stacking_list); + /* on shutdown, don't update the properties, so that we can read it back + in on startup and re-stack the windows as they were before we shut down + */ + if (ob_state == State_Exiting) return; + /* create an array of the window ids (from bottom to top, reverse order!) */ if (size > 0) { windows = g_new(Window, size); win_it = windows; - for (it = g_list_last(stacking_list); it != NULL; it = it->prev, ++win_it) + for (it = g_list_last(stacking_list); it != NULL; + it = it->prev, ++win_it) *win_it = ((Client*)it->data)->window; } else windows = NULL; @@ -96,7 +102,7 @@ void stacking_lower(Client *client) } else { while (it != stacking_list) { Client *c = it->data; - if (client->layer >= c->layer) + if (client->layer <= c->layer) break; it = it->prev; }