From a16e4f8672087eef703c7f61e65b35ea323600af Mon Sep 17 00:00:00 2001 From: Fabio Fantoni Date: Sun, 9 Aug 2026 17:46:16 +0200 Subject: [PATCH] global: Don't create a scope for D-Bus activated applications When an application is started through D-Bus activation the launch context reports pid 0, since the process is spawned by the bus, not by us. Passing that on to gnome_start_systemd_scope() creates an empty app-cinnamon--0.scope that stays active forever, and is pointless anyway: the activated service already runs in its own unit. gnome-shell has the same guard for the same reason. This has no visible effect today only because the scope is never created; it does as soon as that is fixed in cinnamon-desktop. Assisted-by: Claude Code:claude-opus-5 --- src/cinnamon-global.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cinnamon-global.c b/src/cinnamon-global.c index 1f0cb3bf57..afd0503472 100644 --- a/src/cinnamon-global.c +++ b/src/cinnamon-global.c @@ -1681,6 +1681,11 @@ cinnamon_global_app_launched_cb (GAppLaunchContext *context, if (!g_variant_lookup (platform_data, "pid", "i", &pid)) return; + /* If pid == 0 the application was launched through D-Bus + * activation, therefore it's already in its own unit */ + if (pid == 0) + return; + app_name = g_app_info_get_id (info); if (app_name == NULL) app_name = g_app_info_get_executable (info);