]> Dogcows Code - chaz/openbox/blobdiff - openbox/menuframe.c
dont queue up interative end actions
[chaz/openbox] / openbox / menuframe.c
index de84dbf0204e1f325a2cfe8b9d5a1ed73903f171..09fce0511a7ec6941952b067ecaec64b6351af99 100644 (file)
@@ -184,7 +184,7 @@ void menu_frame_move(ObMenuFrame *self, gint x, gint y)
 
 void menu_frame_move_on_screen(ObMenuFrame *self)
 {
-    Rect *a;
+    Rect *a = NULL;
     guint i;
     gint dx = 0, dy = 0;
     gint pos, half;
@@ -591,6 +591,16 @@ void menu_frame_show(ObMenuFrame *self, ObMenuFrame *parent)
     if (g_list_find(menu_frame_visible, self))
         return;
 
+    if (menu_frame_visible == NULL) {
+        /* no menus shown yet */
+        if (!grab_pointer(TRUE, OB_CURSOR_NONE))
+            return;
+        if (!grab_keyboard(TRUE)) {
+            grab_pointer(FALSE, OB_CURSOR_NONE);
+            return;
+        }
+    }
+
     if (parent) {
         if (parent->child)
             menu_frame_hide(parent->child);
@@ -598,12 +608,6 @@ void menu_frame_show(ObMenuFrame *self, ObMenuFrame *parent)
     }
     self->parent = parent;
 
-    if (menu_frame_visible == NULL) {
-        /* no menus shown yet */
-        grab_pointer(TRUE, OB_CURSOR_NONE);
-        grab_keyboard(TRUE);
-    }
-
     /* determine if the underlying menu is already visible */
     for (it = menu_frame_visible; it; it = g_list_next(it)) {
         ObMenuFrame *f = it->data;
This page took 0.020614 seconds and 4 git commands to generate.