aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-03-09 21:29:17 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-03-10 14:33:31 +0200
commit1185438f1ccc4b2a8bcb588a349719975196647b (patch)
tree80f15ce5838ccd855e2ec5555c91ce49e3a0d4c9 /monsterwm.c
parent7dc8e6e9f3f3cfc00ed966325c983a896401f6b1 (diff)
on remove update current with prevfocus
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 552b85b..8575753 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -260,7 +260,7 @@ void client_to_desktop(const Arg *arg) {
if (c == head || !p) head = c->next; else p->next = c->next;
c->next = NULL;
XUnmapWindow(dis, c->win);
- update_current(prevfocus && prevfocus != c ? prevfocus:head);
+ update_current(prevfocus);
if (FOLLOW_WINDOW) change_desktop(arg);
desktopinfo();
@@ -614,7 +614,7 @@ client* prev_client(client *c) {
/* cyclic focus the previous window
* if the window is the head, focus the last stack window */
void prev_win() {
- update_current(prev_client(current));
+ update_current(prev_client(prevfocus = current));
}
/* property notify is called when one of the window's properties
@@ -646,9 +646,8 @@ 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;
- free(c);
- if (c == current) current = NULL;
- update_current((prevfocus && prevfocus != c) ? prevfocus:*p ? *p:head);
+ free(c); c = NULL;
+ update_current(prevfocus);
select_desktop(cd);
}