From: Mikael Magnusson Date: Mon, 10 Dec 2007 03:28:55 +0000 (+0100) Subject: Improve menu behaviour when clicking on grandparents. X-Git-Tag: mikabox-3.4.5~1 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=10603ce092ed38636d2c471d74370a0c1ca24238;p=mikachu%2Fopenbox.git Improve menu behaviour when clicking on grandparents. Some time ago the menus were changed to not trigger on mouseover on a grandparent or higher so that you wouldn't lose a carefully navigated menu structure. Clicking on an item opens it though. It used to be on ButtonRelease but now it is on ButtonPress. Additionally, a Press now causes grandchildren to be closed when clicking on already selected parts of the hierarchy. --- diff --git a/openbox/event.c b/openbox/event.c index 55570a2c..583d0d5f 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1754,16 +1754,20 @@ static gboolean event_handle_menu(XEvent *ev) switch (ev->type) { case ButtonRelease: + case ButtonPress: if (menu_hide_delay_reached() && (ev->xbutton.button < 4 || ev->xbutton.button > 5)) { if ((e = menu_entry_frame_under(ev->xbutton.x_root, ev->xbutton.y_root))) { + if (ev->type == ButtonPress && e->frame->child) + menu_frame_select(e->frame->child, NULL, TRUE); menu_frame_select(e->frame, e, TRUE); - menu_entry_frame_execute(e, ev->xbutton.state); + if (ev->type == ButtonRelease) + menu_entry_frame_execute(e, ev->xbutton.state); } - else + else if (ev->type == ButtonRelease) menu_frame_hide_all(); } break;