all repos — openbox @ 040d344a89f40487de8a1920e0aaeccd93a6a995

openbox fork - make it a bit more like ryudo

don't take KeyRelease events for menus until they receive a KeyPress event first.  avoid using the key binding used to show the menu to execute something inside it.
Dana Jansens danakj@orodu.net
commit

040d344a89f40487de8a1920e0aaeccd93a6a995

parent

78cd9bba523f4986413e3aefe87704e9d11cd081

2 files changed, 8 insertions(+), 1 deletions(-)

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

@@ -1671,6 +1671,8 @@ g_assert_not_reached(); /* there is no active menu */

/* Allow control while going thru the menu */ else if (ev->type == KeyPress && (state & ~ControlMask) == 0) { + frame->got_press = TRUE; + if (keycode == ob_keycode(OB_KEY_ESCAPE)) { menu_frame_hide_all(); ret = TRUE;

@@ -1704,7 +1706,7 @@ get sent to the focused application.

Allow ControlMask only, and don't bother if the menu is empty */ else if (ev->type == KeyRelease && (state & ~ControlMask) == 0 && - frame->entries) + frame->entries && frame->got_press) { if (keycode == ob_keycode(OB_KEY_RETURN)) { /* Enter runs the active item or goes into the submenu.
M openbox/menuframe.hopenbox/menuframe.h

@@ -73,6 +73,11 @@ gint monitor; /* monitor on which to show the menu in xinerama */

RrAppearance *a_title; RrAppearance *a_items; + + gboolean got_press; /* don't allow a KeyRelease event to run things in the + menu until it has seen a KeyPress. this is to + avoid having the keybinding used to show the menu + end up running something inside the menu */ }; struct _ObMenuEntryFrame