summaryrefslogtreecommitdiff
path: root/openbox/menuframe.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-05-11 19:01:33 -0400
committerDana Jansens <danakj@orodu.net>2010-05-11 19:01:33 -0400
commit3fd74abb3c2969f170d727154245cde3ef8a4b87 (patch)
tree392d248fa62e5616d35546216856aa673b3a98c5 /openbox/menuframe.c
parent523a726c6c2f31da36a0af985d22f3792a8c09b5 (diff)
add cleanup function for menus that fires when the menu is no longer visible
Diffstat (limited to 'openbox/menuframe.c')
-rw-r--r--openbox/menuframe.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index 9127257e..91e7c53e 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -1061,14 +1061,15 @@ gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent,
static void menu_frame_hide(ObMenuFrame *self)
{
+ ObMenu *const menu = self->menu;
GList *it = g_list_find(menu_frame_visible, self);
gulong ignore_start;
if (!it)
return;
- if (self->menu->hide_func)
- self->menu->hide_func(self, self->menu->data);
+ if (menu->hide_func)
+ menu->hide_func(self, menu->data);
if (self->child)
menu_frame_hide(self->child);
@@ -1095,6 +1096,9 @@ static void menu_frame_hide(ObMenuFrame *self)
event_end_ignore_all_enters(ignore_start);
menu_frame_free(self);
+
+ if (menu->cleanup_func)
+ menu->cleanup_func(menu, menu->data);
}
void menu_frame_hide_all(void)