From 8c70f3eb08a0d79e7766372f287f0a401c3da5c9 Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Thu, 23 Jun 2011 07:43:05 +0200 Subject: When forgetting about a client, forget about it on *all* workspaces it might be on. If fixed, it's now on all of them. --- mcwm.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mcwm.c b/mcwm.c index 13cfcc0..5a76660 100644 --- a/mcwm.c +++ b/mcwm.c @@ -755,14 +755,26 @@ uint32_t getcolor(const char *colstr) /* Forget everything about client client. */ void forgetclient(struct client *client) { + uint32_t ws; + if (NULL == client) { PDEBUG("forgetclient: client was NULL\n"); return; } - - /* Delete window from workspace list. */ - delfromworkspace(client, curws); + + /* + * Delete this client from whatever workspace lists it belongs to. + * Note that it's OK to be on several workspaces at once even if + * you're not fixed. + */ + for (ws = 0; ws < WORKSPACES; ws ++) + { + if (NULL != client->wsitem[ws]) + { + delfromworkspace(client, ws); + } + } /* Remove from global window list. */ freeitem(&winlist, NULL, client->winitem); @@ -3879,8 +3891,8 @@ void events(void) } forgetclient(client); - - break; + /* We're finished. Break out of for loop. */ + break; } } /* for */ } -- cgit v1.2.3