summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@comhem.se>2007-12-10 04:28:55 +0100
committerMikael Magnusson <mikachu@comhem.se>2008-02-07 16:06:36 +0100
commit9f88642bf44ff2e500221ef140ccb9fc7c645b3d (patch)
tree96cabc65474f76feffba1daef9983b2dc42a4dc0 /openbox
parentf6193ad9e048c5824142d3e7feeb109f91054052 (diff)
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.
Diffstat (limited to 'openbox')
-rw-r--r--openbox/event.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 4fbb97c6..cedac2e3 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -1701,7 +1701,7 @@ static gboolean event_handle_menu_input(XEvent *ev)
{
gboolean ret = FALSE;
- if (ev->type == ButtonRelease) {
+ if (ev->type == ButtonRelease || ev->type == ButtonPress) {
ObMenuEntryFrame *e;
if (menu_hide_delay_reached() &&
@@ -1710,10 +1710,13 @@ static gboolean event_handle_menu_input(XEvent *ev)
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();
}
ret = TRUE;