From c84836ec5ddaf2d0e91c46713475c35652bb540f Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Wed, 12 Jan 2022 16:37:05 +0100 Subject: app_launcher: emit "started" signal for running apps Due to an error in how running apps were handled, applaunchd would emit the "started" signal for D-Bus-activated apps only. This change ensures the signal is emitted for all running apps, regardless of how they were started. Bug-AGL: SPEC-4160 Signed-off-by: Arnaud Ferraris Change-Id: Ibd88223931b51de6c732985c8b886d06886769d5 --- src/app_launcher.c | 5 +++++ src/dbus_activation_manager.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app_launcher.c b/src/app_launcher.c index ddb55c8..5c9bddb 100644 --- a/src/app_launcher.c +++ b/src/app_launcher.c @@ -38,6 +38,10 @@ G_DEFINE_TYPE_WITH_CODE(AppLauncher, app_launcher, G_IMPLEMENT_INTERFACE(APPLAUNCHD_TYPE_APP_LAUNCH, app_launcher_iface_init)); +static void app_launcher_started_cb(AppLauncher *self, + const gchar *app_id, + gpointer caller); + /* * Internal functions */ @@ -215,6 +219,7 @@ static gboolean app_launcher_start_app(AppLauncher *self, AppInfo *app_info) */ if (app_info_get_dbus_activated(app_info)) dbus_activation_manager_activate_app(self->dbus_manager, app_info); + app_launcher_started_cb(self, app_id, NULL); return TRUE; case APP_STATUS_INACTIVE: if (app_info_get_dbus_activated(app_info)) diff --git a/src/dbus_activation_manager.c b/src/dbus_activation_manager.c index 3c31ee6..8c65485 100644 --- a/src/dbus_activation_manager.c +++ b/src/dbus_activation_manager.c @@ -139,6 +139,7 @@ static void dbus_activation_manager_app_started_cb(GDBusConnection *connection, g_debug("Application '%s' appeared on D-Bus", name); app_info_set_status(app_info, APP_STATUS_RUNNING); dbus_activation_manager_activate_app(self, app_info); + g_signal_emit(self, signals[STARTED], 0, app_info_get_app_id(app_info)); } /* @@ -240,8 +241,6 @@ gboolean dbus_activation_manager_activate_app(DBusActivationManager *self, error->message); } - g_signal_emit(self, signals[STARTED], 0, app_id); - return TRUE; } -- cgit