]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
If a window is added to the focus order while focus cycling, stop the focus cycling...
[chaz/openbox] / openbox / event.c
index c77d968a8b3ea77f1ae33a78b06f1f1d8b319cef..2ebea6bacd7ceea6b02ae7db4a9fde50d2875acf 100644 (file)
@@ -1700,14 +1700,23 @@ static gboolean event_handle_menu_keyboard(XEvent *ev)
 
         else if (ob_keycode_match(keycode, OB_KEY_LEFT)) {
             /* Left goes to the parent menu */
-            if (frame->parent)
+            if (frame->parent) {
+                /* remove focus from the child */
                 menu_frame_select(frame, NULL, TRUE);
+                /* and put it in the parent */
+                menu_frame_select(frame->parent, frame->parent->selected,
+                                  TRUE);
+            }
             ret = TRUE;
         }
 
         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;
         }
 
@@ -1720,6 +1729,16 @@ static gboolean event_handle_menu_keyboard(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 doesn't
This page took 0.022794 seconds and 4 git commands to generate.