[gnome-session/wip/laney/systemd-user: 2/6] When there are no required apps (under systemd), let Setenv work



commit 8ce6902936920115c54a37794c72bf0c0feb66c1
Author: Iain Lane <iainl gnome org>
Date:   Fri Jun 15 10:21:48 2018 +0100

    When there are no required apps (under systemd), let Setenv work
    
    Setenv is a mechanism that some clients - notably mutter - use to set
    environment variables for the use of things that are started later. It's
    useful because it forwards changes to the systemd activation
    environment, which is what units use.
    
    Normally it's only available in early startup, but if starting things is
    actually being handled by systemd and not gnome-session, we'll be
    RUNNING without the session actually being "up". We were denying
    mutter's Setenv calls, which set DISPLAY and WAYLAND_DISPLAY, quite
    important environment variables.
    
    Let's try saying that if there are no required apps (the systemd
    situation), you can call Setenv while we're already running too.

 gnome-session/gsm-manager.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
index 6eeea4a6..8032552c 100644
--- a/gnome-session/gsm-manager.c
+++ b/gnome-session/gsm-manager.c
@@ -2576,7 +2576,10 @@ gsm_manager_setenv (GsmExportedManager    *skeleton,
                     const char            *value,
                     GsmManager            *manager)
 {
-        if (manager->priv->phase > GSM_MANAGER_PHASE_INITIALIZATION) {
+        /* When the session is being started outside of gnome-session, by
+         * systemd units, we'll be in RUNNING already */
+        if (manager->priv->phase > GSM_MANAGER_PHASE_INITIALIZATION &&
+            manager->priv->required_apps != NULL) {
                 g_dbus_method_invocation_return_error (invocation,
                                                        GSM_MANAGER_ERROR,
                                                        GSM_MANAGER_ERROR_NOT_IN_INITIALIZATION,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]