X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=bf2fd932cf1f68e2ab90888cb627743641560b73;hb=05d93485b731d304034f6749693ec6b74b210b3d;hp=a063bb8c1f8951548cd5b2828f528e1f6793de9e;hpb=718adbae6534cc5976ac2e3c2f26c22402b27472;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index a063bb8c..bf2fd932 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -772,7 +772,8 @@ static void event_handle_client(ObClient *client, XEvent *e) { /* use where the press occured */ con = frame_context(client, e->xbutton.window, px, py); - con = mouse_button_frame_context(con, e->xbutton.button); + con = mouse_button_frame_context(con, e->xbutton.button, + e->xbutton.state); if (e->type == ButtonRelease && e->xbutton.button == pb) pb = 0, px = py = -1; @@ -1482,8 +1483,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 +1611,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)