From f3285a3d0bf118ce0eba0014ea53b11f47d710d6 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 6 Jan 2010 17:30:42 -0500 Subject: 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. --- openbox/event.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'openbox/event.c') 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; } -- cgit v1.2.3