Merge branch 'backport' into work
[mikachu/openbox.git] / openbox / event.c
index e279c9d..45ae101 100644 (file)
@@ -1816,7 +1816,12 @@ static gboolean event_handle_menu_input(XEvent *ev)
 
             else if (ob_keycode_match(keycode, OB_KEY_RIGHT)) {
                 /* Right goes to the selected submenu */
-                if (frame->child) menu_frame_select_next(frame->child);
+                if (frame->selected->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU)
+                {
+                    /* make sure it is visible */
+                    menu_frame_select(frame, frame->selected, TRUE);
+                    menu_frame_select_next(frame->child);
+                }
                 ret = TRUE;
             }
 
@@ -1829,6 +1834,16 @@ static gboolean event_handle_menu_input(XEvent *ev)
                 menu_frame_select_next(frame);
                 ret = TRUE;
             }
+
+            else if (ob_keycode_match(keycode, OB_KEY_HOME)) {
+                menu_frame_select_first(frame);
+                ret = TRUE;
+            }
+
+            else if (ob_keycode_match(keycode, OB_KEY_END)) {
+                menu_frame_select_last(frame);
+                ret = TRUE;
+            }
         }
 
         /* Use KeyRelease events for running things so that the key release