aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-01-18 04:05:38 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-01-18 04:05:40 +0200
commit4360e1e96fc089753316d5d9b75796ee8d4ba741 (patch)
tree48c786a7e690adb3e67808110fe83e9e9b475530 /monsterwm.c
parent29e0b4957ba461f244934c9c0cae45ae2f3e1059 (diff)
update current client even it was not the one that was removed
this fixes some strange problems with eg LibreOffice Writer that left the client list unfocused, no window was current and not window was focus/highlighted. this will cause some unwanted behavior when one for example kills an app from a terminal that wasn't previously focused.
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 335c621..6380ad3 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -676,7 +676,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;
- if (current == c) current = (prevfocus && prevfocus != c) ? prevfocus : (*p) ? (prevfocus = *p) : (prevfocus = head);
+ current = (prevfocus && prevfocus != c) ? prevfocus : (*p) ? (prevfocus = *p) : (prevfocus = head);
select_desktop(cd);
tile();
if (mode == MONOCLE && cd == --nd && current) XMapWindow(dis, current->win);