From d37cc7e9dfe968f65752e9dafefdce057862b1a0 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 Jul 2015 19:04:00 +0200 Subject: [PATCH] awesome_atexit: keep client order always This is not only useful for soft restarts, but also when TERMinating awesome during development/testing. The drawback appears to be that it would leak a property on the root window in case it is really meant to be quit. Closes https://github.com/awesomeWM/awesome/pull/374. --- awesome.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/awesome.c b/awesome.c index 61bef78bb..ddfa01d54 100644 --- a/awesome.c +++ b/awesome.c @@ -79,18 +79,15 @@ awesome_atexit(bool restart) (*c)->geometry.x, (*c)->geometry.y); } - if (restart) - { - /* Save the client order across restarts */ - xcb_window_t *wins = p_alloca(xcb_window_t, globalconf.clients.len); - int n = 0; - foreach(client, globalconf.clients) - wins[n++] = (*client)->window; + /* Save the client order. This is useful also for "hard" restarts. */ + xcb_window_t *wins = p_alloca(xcb_window_t, globalconf.clients.len); + int n = 0; + foreach(client, globalconf.clients) + wins[n++] = (*client)->window; - xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - globalconf.screen->root, - AWESOME_CLIENT_ORDER, XCB_ATOM_WINDOW, 32, n, wins); - } + xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, + globalconf.screen->root, + AWESOME_CLIENT_ORDER, XCB_ATOM_WINDOW, 32, n, wins); a_dbus_cleanup();