From: Marco Peereboom Date: Tue, 3 Feb 2009 02:21:01 +0000 (+0000) Subject: Check if we are changing workspaces and only unmanage the window if we X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;ds=inline;h=e9824be6280586629060a5d678057b89d60b50fb;p=spectrwm.git Check if we are changing workspaces and only unmanage the window if we are not. --- diff --git a/scrotwm.c b/scrotwm.c index 43ce724..54497fe 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -1027,13 +1027,14 @@ switchws(struct swm_region *r, union arg *args) if (!other_r) { /* if the other workspace is hidden, switch windows */ /* map new window first to prevent ugly blinking */ + old_ws->r = NULL; + old_ws->restack = 1; + TAILQ_FOREACH(win, &new_ws->winlist, entry) XMapRaised(display, win->id); TAILQ_FOREACH(win, &old_ws->winlist, entry) XUnmapWindow(display, win->id); - old_ws->r = NULL; - old_ws->restack = 1; } else { other_r->ws = old_ws; old_ws->r = other_r; @@ -2136,6 +2137,9 @@ unmanage_window(struct ws_win *win) DNPRINTF(SWM_D_MISC, "unmanage_window: %lu\n", win->id); ws = win->ws; + if (ws->restack) + return; + /* find a window to focus */ if (ws->focus == win) ws->focus = TAILQ_PREV(win, ws_win_list, entry);