]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
fix escape's behavior in menus. make static stuff that shouldnt be used by others
[chaz/openbox] / openbox / event.c
index a063bb8c1f8951548cd5b2828f528e1f6793de9e..ace548a6498fbe3b877ed4469cf9740cb3dc9d44 100644 (file)
@@ -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)
This page took 0.024194 seconds and 4 git commands to generate.