summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2017-12-29 18:50:43 +0000
committerokan <okan>2017-12-29 18:50:43 +0000
commit43db5b55eaae67515ae926c0d195c1ef6aa4b607 (patch)
tree38df44627467c7a934ee98e73c80bc44dbfcd2b1 /client.c
parentba75c139531d2a52dfa43a0302d9c8886ed1a820 (diff)
downloadcwm-43db5b55eaae67515ae926c0d195c1ef6aa4b607.tar.gz
cwm-43db5b55eaae67515ae926c0d195c1ef6aa4b607.tar.xz
cwm-43db5b55eaae67515ae926c0d195c1ef6aa4b607.zip
As done for buttonrelease, work specific un-cycling and un-highlighting actions
into the keyrelease event, only performing what's actually needed for each;
should result in much fewer events against keyreleases. No intended behaviour
change.

Additionally, like we do for group membership, grab the keyboard only when
required for cycling.
Diffstat (limited to 'client.c')
-rw-r--r--client.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/client.c b/client.c
index 3a1ce01..91a708a 100644
--- a/client.c
+++ b/client.c
@@ -33,7 +33,6 @@
 
 static struct client_ctx	*client_next(struct client_ctx *);
 static struct client_ctx	*client_prev(struct client_ctx *);
-static void			 client_mtf(struct client_ctx *);
 static void			 client_placecalc(struct client_ctx *);
 static void			 client_wm_protocols(struct client_ctx *);
 static void			 client_mwm_hints(struct client_ctx *);
@@ -683,10 +682,6 @@ client_cycle(struct screen_ctx *sc, int flags)
 	struct client_ctx	*newcc, *oldcc, *prevcc;
 	int			 again = 1;
 
-	/* For X apps that ignore events. */
-	XGrabKeyboard(X_Dpy, sc->rootwin, True,
-	    GrabModeAsync, GrabModeAsync, CurrentTime);
-
 	if (TAILQ_EMPTY(&sc->clientq))
 		return;
 
@@ -730,21 +725,6 @@ client_cycle(struct screen_ctx *sc, int flags)
 	client_ptrwarp(newcc);
 }
 
-void
-client_cycle_leave(struct screen_ctx *sc)
-{
-	struct client_ctx	*cc;
-
-	sc->cycling = 0;
-
-	if ((cc = client_current()) != NULL) {
-		client_mtf(cc);
-		cc->flags &= ~CLIENT_HIGHLIGHT;
-		client_draw_border(cc);
-		XUngrabKeyboard(X_Dpy, CurrentTime);
-	}
-}
-
 static struct client_ctx *
 client_next(struct client_ctx *cc)
 {
@@ -817,7 +797,7 @@ client_placecalc(struct client_ctx *cc)
 	}
 }
 
-static void
+void
 client_mtf(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = cc->sc;