summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--calmwm.h1
-rw-r--r--conf.c2
-rw-r--r--xutil.c6
3 files changed, 8 insertions, 1 deletions
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)
 {