diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-06-07 22:15:28 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-06-07 22:15:28 +0000 |
commit | e5a4ba5371000d1075d18205ecdd25fafbde3c38 (patch) | |
tree | ee8934012f52d77f67be4181b11d193016bd2639 /src | |
parent | b38a660213950fa1aa46d1fd73901eafcd7b8a75 (diff) | |
parent | 014158fd7f63b25840bbcecc92e9ec3f42a7002c (diff) | |
download | ayatana-indicator-messages-e5a4ba5371000d1075d18205ecdd25fafbde3c38.tar.gz ayatana-indicator-messages-e5a4ba5371000d1075d18205ecdd25fafbde3c38.tar.bz2 ayatana-indicator-messages-e5a4ba5371000d1075d18205ecdd25fafbde3c38.zip |
Notify the service when an app unrefs its MessagingMenuApp. Fixes: https://bugs.launchpad.net/bugs/1154099.
Approved by PS Jenkins bot, Ted Gould.
Diffstat (limited to 'src')
-rw-r--r-- | src/messages-service.c | 25 | ||||
-rw-r--r-- | src/messages-service.xml | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index f93cf68..25a19b9 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -474,6 +474,29 @@ unregister_application (IndicatorMessagesService *service, } static void +application_stopped_running (IndicatorMessagesService *service, + GDBusMethodInvocation *invocation, + const gchar *desktop_id, + gpointer user_data) +{ + GDesktopAppInfo *appinfo; + gchar *id; + AppSection *section; + + indicator_messages_service_complete_application_stopped_running (service, invocation); + + if (!(appinfo = g_desktop_app_info_new (desktop_id))) + return; + + id = g_app_info_get_simple_id (G_APP_INFO (appinfo)); + section = g_hash_table_lookup (applications, id); + app_section_unset_object_path (section); + + g_free (id); + g_object_unref (appinfo); +} + +static void set_status (IndicatorMessagesService *service, GDBusMethodInvocation *invocation, const gchar *desktop_id, @@ -650,6 +673,8 @@ main (int argc, char ** argv) G_CALLBACK (register_application), NULL); g_signal_connect (messages_service, "handle-unregister-application", G_CALLBACK (unregister_application), NULL); + g_signal_connect (messages_service, "handle-application-stopped-running", + G_CALLBACK (application_stopped_running), NULL); g_signal_connect (messages_service, "handle-set-status", G_CALLBACK (set_status), NULL); diff --git a/src/messages-service.xml b/src/messages-service.xml index 00ae154..3c3c779 100644 --- a/src/messages-service.xml +++ b/src/messages-service.xml @@ -11,6 +11,10 @@ <arg type="s" name="desktop_id" direction="in" /> </method> + <method name="ApplicationStoppedRunning"> + <arg type="s" name="desktop_id" direction="in" /> + </method> + <method name="SetStatus"> <arg type="s" name="desktop_id" direction="in" /> <arg type="s" name="status" direction="in" /> |