summary refs log tree commit diff
path: root/kbfunc.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 /kbfunc.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 'kbfunc.c')
-rw-r--r--kbfunc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 55e8d67..cf3f7e3 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -398,7 +398,14 @@ kbfunc_client_vtile(void *ctx, struct cargs *cargs)
 void
 kbfunc_client_cycle(void *ctx, struct cargs *cargs)
 {
-	client_cycle(ctx, cargs->flag);
+	struct screen_ctx	*sc = ctx;
+
+	/* For X apps that ignore/steal events. */
+	if (cargs->xev == CWM_XEV_KEY)
+		XGrabKeyboard(X_Dpy, sc->rootwin, True,
+		    GrabModeAsync, GrabModeAsync, CurrentTime);
+
+	client_cycle(sc, cargs->flag);
 }
 
 void
@@ -406,7 +413,7 @@ kbfunc_client_toggle_group(void *ctx, struct cargs *cargs)
 {
 	struct client_ctx	*cc = ctx;
 
-	/* For X apps that steal events. */
+	/* For X apps that ignore/steal events. */
 	if (cargs->xev == CWM_XEV_KEY)
 		XGrabKeyboard(X_Dpy, cc->win, True,
 		    GrabModeAsync, GrabModeAsync, CurrentTime);