Allow selecting menu entries during menuHideDelay if you click again, bug 5501
[mikachu/openbox.git] / openbox / event.c
index 350c148..5774f67 100644 (file)
@@ -1836,8 +1836,14 @@ static gboolean event_handle_menu_input(XEvent *ev)
             if ((e = menu_entry_frame_under(ev->xbutton.x_root,
                                             ev->xbutton.y_root)))
             {
-                if (ev->type == ButtonPress && e->frame->child)
-                    menu_frame_select(e->frame->child, NULL, TRUE);
+                if (ev->type == ButtonPress) {
+                    /* We know this is a new press, so we don't have to
+                     * block release events anymore */
+                    menu_hide_delay_reset();
+
+                    if (e->frame->child)
+                        menu_frame_select(e->frame->child, NULL, TRUE);
+                }
                 menu_frame_select(e->frame, e, TRUE);
                 if (ev->type == ButtonRelease)
                     menu_entry_frame_execute(e, ev->xbutton.state);
@@ -2122,6 +2128,7 @@ static gboolean focus_delay_func(gpointer data)
     if (client_focus(d->client) && config_focus_raise)
         stacking_raise(CLIENT_AS_WINDOW(d->client));
     event_curtime = old;
+
     return FALSE; /* no repeat */
 }
 
@@ -2134,6 +2141,7 @@ static gboolean unfocus_delay_func(gpointer data)
     event_curserial = d->serial;
     focus_nothing();
     event_curtime = old;
+
     return FALSE; /* no repeat */
 }