From ffc48d9851b71b5944b7c85c8d19ee04974255c8 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Tue, 17 Jan 2012 23:35:12 +0200 Subject: only change current if removed client was current --- monsterwm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/monsterwm.c b/monsterwm.c index 6b0d49e..80b350e 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -89,12 +89,8 @@ typedef struct client { * showpanel - the visibility status of the panel */ typedef struct { - int master_size; - int mode; - int growth; - client *head; - client *current; - client *prevfocus; + int master_size, mode, growth; + client *head, *current, *prevfocus; Bool showpanel; } desktop; @@ -686,7 +682,7 @@ void removeclient(client *c) { for (Bool found = False; ndnext); *p = c->next; - current = (prevfocus && prevfocus != current) ? prevfocus : (*p) ? (prevfocus = *p) : (prevfocus = head); + if (current == c) current = (prevfocus && prevfocus != c) ? prevfocus : (*p) ? (prevfocus = *p) : (prevfocus = head); select_desktop(cd); tile(); if (mode == MONOCLE && cd == --nd && current) XMapWindow(dis, current->win); -- cgit v1.3.1