From 8249e264e0f426d6702d21a690477be495045f90 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 19 Feb 2013 19:21:43 -0500 Subject: Notify the service when an app unrefs its MessagingMenuApp Prior to this patch, the messaging menu only marked apps as "not running" when they quit (i.e. disappeared from the bus). This was okay, since most applications only ever release the ref to their MessagingMenuApp when they quit, or after calling _unregister explicitely (which removes them from the menu entirely). However, this is according to libmessagingmenu's documentation, and at least indicator-telepathy relies on it. --- src/messages-service.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/messages-service.c') diff --git a/src/messages-service.c b/src/messages-service.c index 48c830e..e48e3f8 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -472,6 +472,29 @@ unregister_application (IndicatorMessagesService *service, indicator_messages_service_complete_unregister_application (service, invocation); } +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, @@ -648,6 +671,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); -- cgit v1.2.3