about summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authoroga <oga>2009-01-17 18:41:50 +0000
committeroga <oga>2009-01-17 18:41:50 +0000
commitfa87ef4a9e6131597d86b0d3e76cd2e7b6911bcd (patch)
treebabdf0da910b8fd6085519bc0e948719b0f61032 /client.c
parent399253a4ff975c3858b9bba1db8e7aca15860399 (diff)
downloadcwm-fa87ef4a9e6131597d86b0d3e76cd2e7b6911bcd.tar.gz
cwm-fa87ef4a9e6131597d86b0d3e76cd2e7b6911bcd.tar.xz
cwm-fa87ef4a9e6131597d86b0d3e76cd2e7b6911bcd.zip
Finally fix the really annoying race where if you rapidly switch groups several
times you'd end up losing clients (thinking they had gone away).

From the ICCCM (which should not be read without a stiff drink in hand,
I made this mistake so you don't have to): to request a window to be
withdrawn one should send a synthetic UnmapRequest event when iconified.
To request iconification one should just unmap the window. The ICCM
further recommends that the synthetic event should just be taken as a
cue to withdraw, to deal with legacy clients. Taking a hint from this,
rework xev_handle_unmaprequest to correctly detect these situations.  A
Withdrawn window may come back anywhere, even as a subwindow of
something else, so the correct way to handle this state is to forget it
ever existed.

While i'm here, kill a dumb attempt to notice this in client_delete, and
nuke the very unnecessary arguments.

Todd confirmed this fixes the `race'.

ok todd@, ok ok okan@
Diffstat (limited to 'client.c')
-rw-r--r--client.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/client.c b/client.c
index cf72174..ab3bd3d 100644
--- a/client.c
+++ b/client.c
@@ -144,14 +144,11 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
 }
 
 int
-client_delete(struct client_ctx *cc, int sendevent, int ignorewindow)
+client_delete(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = CCTOSC(cc);
 	struct winname		*wn;
 
-	if (cc->state == IconicState && !sendevent)
-		return (1);
-
 	group_client_delete(cc);
 
 	XGrabServer(X_Dpy);