X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fstacking.c;h=1d296e5f604ab5bb0a4b06517711bb0d1767fd01;hb=bf32b376b595eab16a300f63937cad1042361eec;hp=081bde932bb8b0cefbc91e3a2bc4c9dac0eef10a;hpb=f8a47de5ec444c452093371e3db16857eb39a490;p=chaz%2Fopenbox diff --git a/openbox/stacking.c b/openbox/stacking.c index 081bde93..1d296e5f 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; 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; @@ -46,7 +52,7 @@ void stacking_raise(Client *client) /* the stacking list is from highest to lowest */ it = stacking_list; - while (it) { + while (it != NULL) { Client *c = it->data; if (client->layer >= c->layer && m != c) break;