all repos — openbox @ 27773e1cb7492de080bd19189b4fcd2a6b9a0e9e

openbox fork - make it a bit more like ryudo

don't grab the pointer during interactive events. this allows you to alt-tab during a dnd.
Dana Jansens danakj@orodu.net
commit

27773e1cb7492de080bd19189b4fcd2a6b9a0e9e

parent

4c672be2e1f39e72eb7d7e99f129e61338f481b2

5 files changed, 24 insertions(+), 8 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -507,6 +507,8 @@

g_assert(self != NULL); frame_hide(self->frame); + /* sync to send the hide to the server quickly, and to get back the enter + events */ XSync(ob_display, FALSE); if (focus_client == self) {
M openbox/event.copenbox/event.c

@@ -590,9 +590,10 @@ menu_hide_delay_func,

NULL, g_direct_equal, NULL); if (e->type == ButtonPress || e->type == ButtonRelease || - e->type == MotionNotify) - mouse_event(client, e); - else if (e->type == KeyPress) { + e->type == MotionNotify) { + if (!keyboard_interactively_grabbed()) + mouse_event(client, e); + } else if (e->type == KeyPress) { keyboard_event((focus_cycle_target ? focus_cycle_target : (focus_hilite ? focus_hilite : client)), e);

@@ -762,6 +763,8 @@ client->frame->close_hover = FALSE;

frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_FRAME: + if (keyboard_interactively_grabbed()) + break; if (config_focus_follow && config_focus_delay) ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func,

@@ -803,6 +806,8 @@ client->frame->close_hover = TRUE;

frame_adjust_state(client->frame); break; case OB_FRAME_CONTEXT_FRAME: + if (keyboard_interactively_grabbed()) + break; if (e->xcrossing.mode == NotifyGrab || e->xcrossing.mode == NotifyUngrab) {
M openbox/focus.copenbox/focus.c

@@ -328,10 +328,16 @@

void focus_cycle_draw_indicator() { if (!focus_cycle_target) { + XEvent e; + XUnmapWindow(ob_display, focus_indicator.top.win); XUnmapWindow(ob_display, focus_indicator.left.win); XUnmapWindow(ob_display, focus_indicator.right.win); XUnmapWindow(ob_display, focus_indicator.bottom.win); + + /* kill enter events cause by this unmapping */ + XSync(ob_display, FALSE); + while (XCheckTypedEvent(ob_display, EnterNotify, &e)); } else { /* if (focus_cycle_target)
M openbox/keyboard.copenbox/keyboard.c

@@ -164,10 +164,8 @@

g_assert(action->data.any.interactive); if (!interactive_states) { - if (!grab_keyboard(TRUE)) - return FALSE; - if (!grab_pointer(TRUE, FALSE, OB_CURSOR_NONE)) { - grab_keyboard(FALSE); + if (!grab_keyboard(TRUE)) { + ob_debug("grab KEYBOARD failed\n"); return FALSE; } }

@@ -195,7 +193,6 @@ interactive_states = g_slist_remove(interactive_states, s);

if (!interactive_states) { grab_keyboard(FALSE); - grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); keyboard_reset_chains(); } }
M openbox/popup.copenbox/popup.c

@@ -213,8 +213,14 @@

void popup_hide(ObPopup *self) { if (self->mapped) { + XEvent e; + XUnmapWindow(ob_display, self->bg); self->mapped = FALSE; + + /* kill enter events cause by this unmapping */ + XSync(ob_display, FALSE); + while (XCheckTypedEvent(ob_display, EnterNotify, &e)); } }