diff options
author | Michael Cardell Widerkrantz <mc@hack.org> | 2011-06-23 07:18:28 +0200 |
---|---|---|
committer | Michael Cardell Widerkrantz <mc@hack.org> | 2011-06-23 07:18:28 +0200 |
commit | 79340e9afda80e0c064163fb07d179e74aa1d142 (patch) | |
tree | 74e4b618b599104a9d085a3419e6969ec1e8e818 /mcwm.c | |
parent | ba40a52c6e39f578828f629c3d5fdc64f7c82036 (diff) | |
download | mcwm-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.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 */ |