X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=ace548a6498fbe3b877ed4469cf9740cb3dc9d44;hb=83da4ec9398d197f39461cd7305163b2676840c8;hp=a063bb8c1f8951548cd5b2828f528e1f6793de9e;hpb=718adbae6534cc5976ac2e3c2f26c22402b27472;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index a063bb8c..ace548a6 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1482,8 +1482,11 @@ static gboolean event_handle_menu_keyboard(XEvent *ev) ret = FALSE; else if (keycode == ob_keycode(OB_KEY_ESCAPE) && state == 0) { - /* Escape closes the active menu */ - menu_frame_hide(frame); + /* Escape goes to the parent menu or closes the last one */ + if (frame->parent) + menu_frame_select(frame, NULL, TRUE); + else + menu_frame_hide_all(); } else if (keycode == ob_keycode(OB_KEY_RETURN) && (state == 0 || @@ -1607,6 +1610,10 @@ static gboolean event_handle_menu(XEvent *ev) } break; case LeaveNotify: + /*ignore leaves when we're already in the window */ + if (ev->xcrossing.detail == NotifyInferior) + break; + if ((e = g_hash_table_lookup(menu_frame_map, &ev->xcrossing.window)) && (f = find_active_menu()) && f->selected == e && e->entry->type != OB_MENU_ENTRY_TYPE_SUBMENU)