aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/im-application-list.c6
-rw-r--r--src/messages-service.c24
2 files changed, 30 insertions, 0 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c
index 4f5903a..7862f1a 100644
--- a/src/im-application-list.c
+++ b/src/im-application-list.c
@@ -1158,6 +1158,12 @@ im_application_list_set_remote (ImApplicationList *list,
return;
}
+ if (!connection && !unique_bus_name && !object_path)
+ {
+ im_application_list_unset_remote (app);
+ return;
+ }
+
if (app->cancellable)
{
gchar *name_owner = NULL;
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",