diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2010-01-18 16:48:00 +0100 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-01-28 08:40:07 -0500 |
| commit | 0cd6f4e43c355ef6b568c769a4ecb2983d5f3fa6 (patch) | |
| tree | 7ea6ffc1f845c3e0a3fffa336010ab1d9d224d52 /openbox/menuframe.c | |
| parent | 7cfaae8da9271a7bad4c73886c894a14cbf456e7 (diff) | |
Add a hook to unset the client in the open menu frame instead of closing it
Also nukes menu_frame_hide_all_client() as it is now unused.
Diffstat (limited to 'openbox/menuframe.c')
| -rw-r--r-- | openbox/menuframe.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/openbox/menuframe.c b/openbox/menuframe.c index afffc837..4ee5d31e 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -61,6 +61,19 @@ static Window createWindow(Window parent, gulong mask, RrVisual(ob_rr_inst), mask, attrib); } +static void client_dest(ObClient *client, gpointer data) +{ + GList *it; + + /* menus can be associated with a client, so null those refs since + we are disappearing now */ + for (it = menu_frame_visible; it; it = g_list_next(it)) { + ObMenuFrame *f = it->data; + if (f->client == client) + f->client = NULL; + } +} + void menu_frame_startup(gboolean reconfig) { gint i; @@ -75,6 +88,7 @@ void menu_frame_startup(gboolean reconfig) if (reconfig) return; + client_add_destroy_notify(client_dest, NULL); menu_frame_map = g_hash_table_new(g_int_hash, g_int_equal); } @@ -84,6 +98,7 @@ void menu_frame_shutdown(gboolean reconfig) if (reconfig) return; + client_remove_destroy_notify(client_dest); g_hash_table_destroy(menu_frame_map); } @@ -1090,22 +1105,6 @@ void menu_frame_hide_all(void) menu_frame_hide(it->data); } -void menu_frame_hide_all_client(ObClient *client) -{ - GList *it = g_list_last(menu_frame_visible); - if (it) { - ObMenuFrame *f = it->data; - if (f->client == client) { - if (config_submenu_show_delay) { - /* remove any submenu open requests */ - obt_main_loop_timeout_remove(ob_main_loop, - submenu_show_timeout); - } - menu_frame_hide(f); - } - } -} - ObMenuFrame* menu_frame_under(gint x, gint y) { ObMenuFrame *ret = NULL; |
