diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-01-17 23:35:12 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-01-17 23:35:44 +0200 |
| commit | ffc48d9851b71b5944b7c85c8d19ee04974255c8 (patch) | |
| tree | 32a25b50d4b1177f3f6fc4eacf7648d346e42234 | |
| parent | 4723e88826622b637a3d3b153718fbbfebdc810a (diff) | |
only change current if removed client was current
| -rw-r--r-- | monsterwm.c | 10 |
1 files 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; nd<DESKTOPS && !found; nd++) for (select_desktop(nd), p = &head; *p && !(found = *p == c); p = &(*p)->next); *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); |
