summaryrefslogtreecommitdiff
path: root/app/cwm/kbfunc.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2017-12-29 18:50:44 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2017-12-29 18:50:44 +0000
commit257c29b27424301ee78a7434391b2cfcfbab527e (patch)
tree9f850572a471f1ccfc6dbf2293a1306d1f8db6c0 /app/cwm/kbfunc.c
parent2ac6adfc517aafee63f26fd109cac34e00d092a8 (diff)
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 'app/cwm/kbfunc.c')
-rw-r--r--app/cwm/kbfunc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index e2ecca18b..cbeba3614 100644
--- a/app/cwm/kbfunc.c
+++ b/app/cwm/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: kbfunc.c,v 1.157 2017/12/29 16:55:50 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.158 2017/12/29 18:50:43 okan Exp $
*/
#include <sys/types.h>
@@ -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);