summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2011-06-23 07:18:28 +0200
committerMichael Cardell Widerkrantz <mc@hack.org>2011-06-23 07:18:28 +0200
commit79340e9afda80e0c064163fb07d179e74aa1d142 (patch)
tree74e4b618b599104a9d085a3419e6969ec1e8e818 /mcwm.c
parentba40a52c6e39f578828f629c3d5fdc64f7c82036 (diff)
downloadmcwm-79340e9afda80e0c064163fb07d179e74aa1d142.zip
Use freeitem() instead of explicitly freeing from global window list.
If a window is unmapped and we are going to forget about it we need to take into consideration if it's currently focused.
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mcwm.c b/mcwm.c
index 5f1bdbf..13cfcc0 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -764,9 +764,8 @@ void forgetclient(struct client *client)
/* Delete window from workspace list. */
delfromworkspace(client, curws);
- free(client->winitem->data);
-
- delitem(&winlist, client->winitem);
+ /* Remove from global window list. */
+ freeitem(&winlist, NULL, client->winitem);
}
/* Forget everything about a client with client->id win. */
@@ -3874,7 +3873,13 @@ void events(void)
if (client->id == e->window)
{
PDEBUG("Forgetting about %d\n", e->window);
+ if (focuswin == client)
+ {
+ focuswin = NULL;
+ }
+
forgetclient(client);
+
break;
}
} /* for */