summaryrefslogtreecommitdiff
path: root/openbox/event.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-26 22:13:34 +0000
committerDana Jansens <danakj@orodu.net>2007-05-26 22:13:34 +0000
commit5e9e266722826fbd5907df1bf900864ab23f6539 (patch)
tree8750a5187dd73edaa93433be6d8d5c459abd6aaa /openbox/event.c
parent4a45cabd4fb99ac787a3f84f89541e1c76e578b4 (diff)
change in how things are ungrabbed to avoid grabwhilenotify. don't ungrab every key press. just ungrab the passive grab when there is no active grab and we are going to move focus.
this should be less intrusive and seems to work
Diffstat (limited to 'openbox/event.c')
-rw-r--r--openbox/event.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbox/event.c b/openbox/event.c
index cb739339..e7ef27fb 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -1837,6 +1837,25 @@ static gboolean is_enter_focus_event_ignored(XEvent *e)
return FALSE;
}
+void event_cancel_all_key_grabs()
+{
+ if (keyboard_interactively_grabbed())
+ keyboard_interactive_cancel();
+ else if (menu_frame_visible)
+ menu_frame_hide_all();
+ else if (grab_on_keyboard())
+ ungrab_keyboard();
+ else
+ /* If we don't have the keyboard grabbed, then ungrab it with
+ XUngrabKeyboard, so that there is not a passive grab left
+ on from the KeyPress. If the grab is left on, and focus
+ moves during that time, it will be NotifyWhileGrabbed, and
+ applications like to ignore those! */
+ if (!keyboard_interactively_grabbed())
+ XUngrabKeyboard(ob_display, CurrentTime);
+
+}
+
gboolean event_time_after(Time t1, Time t2)
{
g_assert(t1 != CurrentTime);