diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-27 11:06:05 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-27 11:06:05 +0200 |
commit | 0eae4379c30b5afe8f21f88b30c7ce5d795556d0 (patch) | |
tree | be7ef4eb8c648d62dd6614db37acbd886f9d67c6 /src | |
parent | 0d54cdd2276dfd43af9b7849da8e214d76c306f3 (diff) | |
download | ayatana-indicator-messages-0eae4379c30b5afe8f21f88b30c7ce5d795556d0.tar.gz ayatana-indicator-messages-0eae4379c30b5afe8f21f88b30c7ce5d795556d0.tar.bz2 ayatana-indicator-messages-0eae4379c30b5afe8f21f88b30c7ce5d795556d0.zip |
desktop menu: remove all sources when an application has quit
Diffstat (limited to 'src')
-rw-r--r-- | src/im-desktop-menu.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/im-desktop-menu.c b/src/im-desktop-menu.c index 834a8c9..f70ff54 100644 --- a/src/im-desktop-menu.c +++ b/src/im-desktop-menu.c @@ -184,6 +184,21 @@ im_desktop_menu_remove_all (ImApplicationList *applist, } } +static void +im_desktop_menu_app_stopped (ImApplicationList *applist, + const gchar *app_id, + gpointer user_data) +{ + ImDesktopMenu *menu = user_data; + GMenu *section; + + section = g_hash_table_lookup (menu->source_sections, app_id); + g_return_if_fail (section != NULL); + + while (g_menu_model_get_n_items (G_MENU_MODEL (section)) > 0) + g_menu_remove (section, 0); +} + static GMenu * create_status_section (void) { @@ -263,6 +278,7 @@ im_desktop_menu_constructed (GObject *object) g_signal_connect (applist, "source-added", G_CALLBACK (im_desktop_menu_source_added), menu); g_signal_connect (applist, "source-removed", G_CALLBACK (im_desktop_menu_source_removed), menu); g_signal_connect (applist, "remove-all", G_CALLBACK (im_desktop_menu_remove_all), menu); + g_signal_connect (applist, "app-stopped", G_CALLBACK (im_desktop_menu_app_stopped), menu); G_OBJECT_CLASS (im_desktop_menu_parent_class)->constructed (object); } |