all repos — openbox @ c8983c42a7c27321d18825f2a130c15e29046f7b

openbox fork - make it a bit more like ryudo

playing a bit with grabs
make mouse clicks cancel alt-tab and stuff if you arent dragging during the alt-tab
Dana Jansens danakj@orodu.net
commit

c8983c42a7c27321d18825f2a130c15e29046f7b

parent

05560c929ba196c7f0abd8332ccb19650b2cf316

3 files changed, 10 insertions(+), 10 deletions(-)

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

@@ -166,16 +166,11 @@

xerror_set_ignore(TRUE); /* can get BadAccess from these */ xerror_occured = FALSE; for (i = 0; i < MASK_LIST_SIZE; ++i) - XGrabButton(ob_display, button, state | mask_list[i], win, FALSE, mask, - pointer_mode, GrabModeSync, None, ob_cursor(cur)); + XGrabButton(ob_display, button, state | mask_list[i], win, False, mask, + pointer_mode, GrabModeAsync, None, ob_cursor(cur)); xerror_set_ignore(FALSE); if (xerror_occured) ob_debug("Failed to grab button %d modifiers %d", button, state); -} - -void grab_button(guint button, guint state, Window win, guint mask) -{ - grab_button_full(button, state, win, mask, GrabModeAsync, OB_CURSOR_NONE); } void ungrab_button(guint button, guint state, Window win)
M openbox/grab.hopenbox/grab.h

@@ -34,7 +34,6 @@

gboolean grab_on_keyboard(); gboolean grab_on_pointer(); -void grab_button(guint button, guint state, Window win, guint mask); void grab_button_full(guint button, guint state, Window win, guint mask, gint pointer_mode, ObCursor cursor); void ungrab_button(guint button, guint state, Window win);
M openbox/keyboard.copenbox/keyboard.c

@@ -159,8 +159,11 @@

g_assert(action->data.any.interactive); if (!interactive_states) { - if (!grab_keyboard(TRUE)) + grab_pointer(TRUE, FALSE, OB_CURSOR_POINTER); + if (!grab_keyboard(TRUE)) { + grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); return FALSE; + } } s = g_new(ObInteractiveState, 1);

@@ -186,6 +189,7 @@ interactive_states = g_slist_remove(interactive_states, s);

if (!interactive_states) { grab_keyboard(FALSE); + grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); keyboard_reset_chains(); } }

@@ -224,7 +228,9 @@ /*if (e->xkey.keycode == ob_keycode(OB_KEY_RETURN))

done = TRUE; else */if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) cancel = done = TRUE; - } + } else if (e->type == ButtonPress) + cancel = done = TRUE; + if (done) { keyboard_interactive_end(s, e->xkey.state, cancel, e->xkey.time);