From 5e9e266722826fbd5907df1bf900864ab23f6539 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 26 May 2007 22:13:34 +0000 Subject: 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 --- openbox/event.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openbox/event.c') 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); -- cgit v1.2.3