Fix a typo causing submenuShowDelay to be ignored (Bug 6019)
[dana/openbox.git] / openbox / menuframe.c
index 6110045..3252bb3 100644 (file)
@@ -38,7 +38,8 @@
 #define FRAME_EVENTMASK (ButtonPressMask |ButtonMotionMask | EnterWindowMask |\
                          LeaveWindowMask)
 #define ENTRY_EVENTMASK (EnterWindowMask | LeaveWindowMask | \
-                         ButtonPressMask | ButtonReleaseMask)
+                         ButtonPressMask | ButtonReleaseMask | \
+                         PointerMotionMask)
 
 GList *menu_frame_visible;
 GHashTable *menu_frame_map;
@@ -1046,8 +1047,11 @@ gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent,
         parent->child_entry = parent_entry;
     }
 
-    if (!menu_frame_show(self))
+    if (!menu_frame_show(self)) {
+        parent->child = NULL;
+        parent->child_entry = NULL;
         return FALSE;
+    }
 
     menu_frame_place_submenu(self, &x, &y);
     menu_frame_move_on_screen(self, x, y, &dx, &dy);
@@ -1238,9 +1242,9 @@ void menu_frame_select(ObMenuFrame *self, ObMenuEntryFrame *entry,
         if (self->selected->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) {
             /* only show if the submenu isn't already showing */
             if (oldchild_entry != self->selected) {
-                if (immediate || config_submenu_hide_delay == 0)
+                if (immediate || config_submenu_show_delay == 0)
                     menu_entry_frame_show_submenu(self->selected);
-                else if (config_submenu_hide_delay > 0) {
+                else if (config_submenu_show_delay > 0) {
                     if (submenu_show_timer)
                         g_source_remove(submenu_show_timer);
                     submenu_show_timer =
@@ -1272,7 +1276,8 @@ void menu_entry_frame_show_submenu(ObMenuEntryFrame *self)
     /* pass our direction on to our child */
     f->direction_right = self->frame->direction_right;
 
-    menu_frame_show_submenu(f, self->frame, self);
+    if (!menu_frame_show_submenu(f, self->frame, self))
+        menu_frame_free(f);
 }
 
 void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state)