Merge lp:~larsu/indicator-messages/listen-to-app-stopped-running into lp:indicator-messages/14.04

Proposed by Lars Karlitski
Status: Merged
Approved by: Charles Kerr
Approved revision: 410
Merged at revision: 411
Proposed branch: lp:~larsu/indicator-messages/listen-to-app-stopped-running
Merge into: lp:indicator-messages/14.04
Diff against target: 58 lines (+30/-0)
2 files modified
src/im-application-list.c (+6/-0)
src/messages-service.c (+24/-0)
To merge this branch: bzr merge lp:~larsu/indicator-messages/listen-to-app-stopped-running
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+215103@code.launchpad.net

Commit message

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.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/im-application-list.c'
2--- src/im-application-list.c 2014-04-07 10:00:10 +0000
3+++ src/im-application-list.c 2014-04-10 08:27:23 +0000
4@@ -1158,6 +1158,12 @@
5 return;
6 }
7
8+ if (!connection && !unique_bus_name && !object_path)
9+ {
10+ im_application_list_unset_remote (app);
11+ return;
12+ }
13+
14 if (app->cancellable)
15 {
16 gchar *name_owner = NULL;
17
18=== modified file 'src/messages-service.c'
19--- src/messages-service.c 2013-10-04 09:22:00 +0000
20+++ src/messages-service.c 2014-04-10 08:27:23 +0000
21@@ -123,6 +123,28 @@
22 return TRUE;
23 }
24
25+static gboolean
26+app_stopped (IndicatorMessagesService *service,
27+ GDBusMethodInvocation *invocation,
28+ const gchar *desktop_id,
29+ gpointer user_data)
30+{
31+ GDesktopAppInfo *appinfo;
32+ const gchar *id;
33+
34+ appinfo = g_desktop_app_info_new (desktop_id);
35+ if (!appinfo)
36+ return TRUE;
37+
38+ id = g_app_info_get_id (G_APP_INFO (appinfo));
39+ im_application_list_set_remote (applications, id, NULL, NULL, NULL);
40+ indicator_messages_service_complete_application_stopped_running (service, invocation);
41+
42+ g_object_unref (appinfo);
43+
44+ return TRUE;
45+}
46+
47 /* The status has been set by the user, let's tell the world! */
48 static void
49 status_set_by_user (ImApplicationList * list, const gchar * status, gpointer user_data)
50@@ -231,6 +253,8 @@
51 G_CALLBACK (unregister_application), NULL);
52 g_signal_connect (messages_service, "handle-set-status",
53 G_CALLBACK (set_status), NULL);
54+ g_signal_connect (messages_service, "handle-application-stopped-running",
55+ G_CALLBACK (app_stopped), NULL);
56
57 applications = im_application_list_new ();
58 g_signal_connect (applications, "status-set",

Subscribers

People subscribed via source and target branches