From 8881be9d57cc79b57cd60a9040695dc3c7df5bfa Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 24 Jan 2011 16:45:56 -0500 Subject: [PATCH] Fix for when the menu's update function returns FALSE and no menu is shown. The ObMenuFrame was not being freed, and the child pointer was being left pointing to the frame that was not visible. --- openbox/menuframe.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 6110045c..4887173b 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -1046,8 +1046,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); @@ -1272,7 +1275,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) -- 2.34.1