diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-04-10 12:06:55 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-04-10 12:06:55 +0000 |
commit | f78aa1d7acfacd2027b1f18733e2137e9176f783 (patch) | |
tree | 03d84f5331ba926d8cfa787a47d03d463a69d780 /src/messages-service.c | |
parent | 79b77a977e27c53556ae8bed46c8c43e68608497 (diff) | |
parent | 802a58902dd40df8b683ec702c8d2d1a90120f90 (diff) | |
download | ayatana-indicator-messages-f78aa1d7acfacd2027b1f18733e2137e9176f783.tar.gz ayatana-indicator-messages-f78aa1d7acfacd2027b1f18733e2137e9176f783.tar.bz2 ayatana-indicator-messages-f78aa1d7acfacd2027b1f18733e2137e9176f783.zip |
messages-service: listen to the ApplicationStoppedRunning call
Prior to this patch, only applications that exit were marked as "not running". However, this must also happen when an application unrefs it's MessagingMenuApp instance. This is a problem for applications which implement messaging menu integration as a plugin (when unloading the plugin).
Specifically, this causes bug #1302930, as telepathy-indicator doesn't exit when empathy exits. Fixes: 1302930
Diffstat (limited to 'src/messages-service.c')
-rw-r--r-- | src/messages-service.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 129b082..d1ccbbc 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -123,6 +123,28 @@ set_status (IndicatorMessagesService *service, return TRUE; } +static gboolean +app_stopped (IndicatorMessagesService *service, + GDBusMethodInvocation *invocation, + const gchar *desktop_id, + gpointer user_data) +{ + GDesktopAppInfo *appinfo; + const gchar *id; + + appinfo = g_desktop_app_info_new (desktop_id); + if (!appinfo) + return TRUE; + + id = g_app_info_get_id (G_APP_INFO (appinfo)); + im_application_list_set_remote (applications, id, NULL, NULL, NULL); + indicator_messages_service_complete_application_stopped_running (service, invocation); + + g_object_unref (appinfo); + + return TRUE; +} + /* The status has been set by the user, let's tell the world! */ static void status_set_by_user (ImApplicationList * list, const gchar * status, gpointer user_data) @@ -231,6 +253,8 @@ main (int argc, char ** argv) G_CALLBACK (unregister_application), NULL); g_signal_connect (messages_service, "handle-set-status", G_CALLBACK (set_status), NULL); + g_signal_connect (messages_service, "handle-application-stopped-running", + G_CALLBACK (app_stopped), NULL); applications = im_application_list_new (); g_signal_connect (applications, "status-set", |