gchar **strippedlabel, guint *position,
gboolean *always_show);
-static void client_dest(ObClient *client, gpointer data)
-{
- /* menus can be associated with a client, so close any that are since
- we are disappearing now */
- menu_frame_hide_all_client(client);
-}
-
void menu_startup(gboolean reconfig)
{
gboolean loaded = FALSE;
}
g_assert(menu_parse_state.parent == NULL);
-
- if (!reconfig)
- client_add_destroy_notify(client_dest, NULL);
}
void menu_shutdown(gboolean reconfig)
{
- if (!reconfig)
- client_remove_destroy_notify(client_dest);
-
obt_xml_instance_unref(menu_parse_inst);
menu_parse_inst = NULL;
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;
if (reconfig) return;
+ client_add_destroy_notify(client_dest, NULL);
menu_frame_map = g_hash_table_new(g_int_hash, g_int_equal);
}
if (reconfig) return;
+ client_remove_destroy_notify(client_dest);
g_hash_table_destroy(menu_frame_map);
}
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;