From 8e76e328639ba42cdafa5306f924b0491faec969 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 30 Aug 2003 17:46:23 +0000 Subject: add destructor functions for clients that you acn subscribe with, and use these instead of hardcoding special cases in the unmanage code --- openbox/menu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'openbox/menu.c') diff --git a/openbox/menu.c b/openbox/menu.c index 8a4c28b9..c8e16e48 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -55,6 +55,13 @@ static gboolean menu_open(gchar *file, xmlDocPtr *doc, xmlNodePtr *node) return loaded; } +static void client_dest(ObClient *c) +{ + /* menus can be associated with a client, so close any that are since + we are disappearing now */ + menu_frame_hide_all_client(c); +} + void menu_startup() { xmlDocPtr doc; @@ -91,10 +98,14 @@ void menu_startup() g_assert(menu_parse_state.menus == NULL); } + + client_add_destructor(client_dest); } void menu_shutdown() { + client_remove_destructor(client_dest); + parse_shutdown(menu_parse_inst); menu_parse_inst = NULL; -- cgit v1.2.3