summaryrefslogtreecommitdiff
path: root/openbox/event.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-01-06 17:30:42 -0500
committerDana Jansens <danakj@orodu.net>2010-01-06 17:30:42 -0500
commitf3285a3d0bf118ce0eba0014ea53b11f47d710d6 (patch)
tree02b305d95d72ebeceff7e58f3cb023eb03a692cb /openbox/event.c
parent8ed0970b65e2a74c122059aed8c69057c129db35 (diff)
Improved menu behaviour
Make 'left' key in a menu close it's visible child menu and move to the parent properly. Make clicking on a menu item in a menu close any of its grandchildren and remove focus from its children, effectively focusing the menu item you clicked on.
Diffstat (limited to 'openbox/event.c')
-rw-r--r--openbox/event.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbox/event.c b/openbox/event.c
index c77d968a..ad9dade6 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -1700,8 +1700,13 @@ static gboolean event_handle_menu_keyboard(XEvent *ev)
else if (ob_keycode_match(keycode, OB_KEY_LEFT)) {
/* Left goes to the parent menu */
- if (frame->parent)
+ if (frame->parent) {
+ /* remove focus from the child */
menu_frame_select(frame, NULL, TRUE);
+ /* and put it in the parent */
+ menu_frame_select(frame->parent, frame->parent->selected,
+ TRUE);
+ }
ret = TRUE;
}