]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
if we get an event on a subwindow of root that we don't know about, but it is related...
[chaz/openbox] / openbox / event.c
index e279c9db9918246b9eaf96ea30528122af7cb4ca..51cfc658c638a9db5128f4fd3a70d71216715acd 100644 (file)
@@ -719,22 +719,27 @@ static void event_process(const XEvent *ec, gpointer data)
 #endif
 
     if (e->type == ButtonPress || e->type == ButtonRelease) {
+        ObWindow *w;
+        static guint pressed = 0;
+        static Window pressed_win = None;
+
         /* If the button press was on some non-root window, or was physically
-           on the root window, then process it */
+           on the root window... */
         if (window != obt_root(ob_screen) ||
-            e->xbutton.subwindow == None)
+            e->xbutton.subwindow == None ||
+            /* ...or if it is related to the last button press we handled... */
+            pressed == e->xbutton.button ||
+            /* ...or it if it was physically on an openbox
+               internal window... */
+            ((w = window_find(e->xbutton.subwindow)) &&
+             WINDOW_IS_INTERNAL(w)))
+            /* ...then process the event, otherwise ignore it */
         {
             used = event_handle_user_input(client, e);
-        }
-        /* Otherwise only process it if it was physically on an openbox
-           internal window */
-        else {
-            ObWindow *w;
 
-            if ((w = window_find(e->xbutton.subwindow)) &&
-                WINDOW_IS_INTERNAL(w))
-            {
-                used = event_handle_user_input(client, e);
+            if (e->type == ButtonPress) {
+                pressed = e->xbutton.button;
+                pressed_win = e->xbutton.subwindow;
             }
         }
     }
@@ -1816,7 +1821,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 +1839,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
This page took 0.027269 seconds and 4 git commands to generate.