From 5b733a152daa01493301333a7e756394f9b45455 Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 20 Oct 2013 01:55:32 +0000 Subject: [PATCH] wrap key ungrab like btn ungrab, for it'll be used again --- calmwm.h | 1 + conf.c | 2 +- xutil.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/calmwm.h b/calmwm.h index e888bac..5a827b4 100644 --- a/calmwm.h +++ b/calmwm.h @@ -516,6 +516,7 @@ int xu_getprop(Window, Atom, Atom, long, unsigned char **); int xu_get_wm_state(Window, int *); int xu_getstrprop(Window, Atom, char **); void xu_key_grab(Window, u_int, KeySym); +void xu_key_ungrab(Window); void xu_ptr_getpos(Window, int *, int *); int xu_ptr_grab(Window, u_int, Cursor); int xu_ptr_regrab(u_int, Cursor); diff --git a/conf.c b/conf.c index ce3ee1e..68a5351 100644 --- a/conf.c +++ b/conf.c @@ -663,7 +663,7 @@ conf_grab_kbd(Window win) { struct keybinding *kb; - XUngrabKey(X_Dpy, AnyKey, AnyModifier, win); + xu_key_ungrab(win); TAILQ_FOREACH(kb, &Conf.keybindingq, entry) xu_key_grab(win, kb->modmask, kb->keysym); diff --git a/xutil.c b/xutil.c index f33fa9a..30a89f8 100644 --- a/xutil.c +++ b/xutil.c @@ -102,6 +102,12 @@ xu_key_grab(Window win, u_int mask, KeySym keysym) True, GrabModeAsync, GrabModeAsync); } +void +xu_key_ungrab(Window win) +{ + XUngrabKey(X_Dpy, AnyKey, AnyModifier, win); +} + int xu_getprop(Window win, Atom atm, Atom type, long len, unsigned char **p) {