From: Dana Jansens Date: Wed, 4 Jun 2003 22:45:54 +0000 (+0000) Subject: make key grabbing per window instead of always root X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=795d90c3bc57eaf2c98c447f3af5c1c9e7a52fa3;p=chaz%2Fopenbox make key grabbing per window instead of always root --- diff --git a/openbox/grab.c b/openbox/grab.c index 656f6eb4..e934959d 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -119,21 +119,21 @@ void ungrab_button(guint button, guint state, Window win) XUngrabButton(ob_display, button, state | mask_list[i], win); } -void grab_key(guint keycode, guint state, int keyboard_mode) +void grab_key(guint keycode, guint state, Window win, int keyboard_mode) { guint i; xerror_set_ignore(TRUE); /* can get BadAccess' from these */ xerror_occured = FALSE; for (i = 0; i < MASK_LIST_SIZE; ++i) - XGrabKey(ob_display, keycode, state | mask_list[i], ob_root, FALSE, + XGrabKey(ob_display, keycode, state | mask_list[i], win, FALSE, GrabModeSync, keyboard_mode); xerror_set_ignore(FALSE); if (xerror_occured) g_warning("failed to grab keycode %d modifiers %d", keycode, state); } -void ungrab_all_keys() +void ungrab_all_keys(Window win) { - XUngrabKey(ob_display, AnyKey, AnyModifier, ob_root); + XUngrabKey(ob_display, AnyKey, AnyModifier, win); } diff --git a/openbox/grab.h b/openbox/grab.h index 04fa690a..d6c149b3 100644 --- a/openbox/grab.h +++ b/openbox/grab.h @@ -17,8 +17,8 @@ void grab_button_full(guint button, guint state, Window win, guint mask, int pointer_mode, Cursor cursor); void ungrab_button(guint button, guint state, Window win); -void grab_key(guint keycode, guint state, int keyboard_mode); +void grab_key(guint keycode, guint state, Window win, int keyboard_mode); -void ungrab_all_keys(); +void ungrab_all_keys(Window win); #endif