Blame SOURCES/0002-autostart-ensure-gnome-shell-and-mutter-get-right-au.patch

f47161
From 625609b907e37e30fa29eaf7beb9426fd2405eaa Mon Sep 17 00:00:00 2001
b31790
From: Ray Strode <rstrode@redhat.com>
b31790
Date: Thu, 18 Jan 2018 10:09:36 -0500
b31790
Subject: [PATCH 2/2] autostart: ensure gnome-shell and mutter get right
b31790
 autostart phase
b31790
b31790
Previous versions of gnome-shell neglected to save the autostart phases
b31790
for required components in the session state. While that is now fixed,
b31790
users may still have old saved state that lack the autostart phase.
b31790
b31790
In order to ease upgrades, this commit manually adds in the phases that
b31790
are important for a functioning GNOME desktop.
b31790
---
b31790
 gnome-session/gsm-autostart-app.c | 12 +++++++++++-
b31790
 1 file changed, 11 insertions(+), 1 deletion(-)
b31790
b31790
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
f47161
index 2332b039..584a9105 100644
b31790
--- a/gnome-session/gsm-autostart-app.c
b31790
+++ b/gnome-session/gsm-autostart-app.c
f47161
@@ -545,61 +545,71 @@ load_desktop_file (GsmAutostartApp  *app)
b31790
         char    *startup_id;
b31790
         char    *phase_str;
b31790
         int      phase;
b31790
         gboolean res;
b31790
 
b31790
         g_assert (app->priv->app_info != NULL);
b31790
 
b31790
         phase_str = g_desktop_app_info_get_string (app->priv->app_info,
b31790
                                                    GSM_AUTOSTART_APP_PHASE_KEY);
b31790
         if (phase_str != NULL) {
b31790
                 if (strcmp (phase_str, "EarlyInitialization") == 0) {
b31790
                         phase = GSM_MANAGER_PHASE_EARLY_INITIALIZATION;
b31790
                 } else if (strcmp (phase_str, "PreDisplayServer") == 0) {
b31790
                         phase = GSM_MANAGER_PHASE_PRE_DISPLAY_SERVER;
b31790
                 } else if (strcmp (phase_str, "DisplayServer") == 0) {
b31790
                         phase = GSM_MANAGER_PHASE_DISPLAY_SERVER;
b31790
                 } else if (strcmp (phase_str, "Initialization") == 0) {
b31790
                         phase = GSM_MANAGER_PHASE_INITIALIZATION;
b31790
                 } else if (strcmp (phase_str, "WindowManager") == 0) {
b31790
                         phase = GSM_MANAGER_PHASE_WINDOW_MANAGER;
b31790
                 } else if (strcmp (phase_str, "Panel") == 0) {
b31790
                         phase = GSM_MANAGER_PHASE_PANEL;
b31790
                 } else if (strcmp (phase_str, "Desktop") == 0) {
b31790
                         phase = GSM_MANAGER_PHASE_DESKTOP;
b31790
                 } else {
b31790
                         phase = GSM_MANAGER_PHASE_APPLICATION;
b31790
                 }
b31790
 
b31790
                 g_free (phase_str);
b31790
         } else {
b31790
-                phase = GSM_MANAGER_PHASE_APPLICATION;
b31790
+                const char *app_id;
b31790
+
b31790
+                app_id = g_app_info_get_id (G_APP_INFO (app->priv->app_info));
b31790
+
b31790
+                /* These hardcoded checks are to keep upgrades working */
b31790
+                if (app_id != NULL && g_str_has_prefix (app_id, "org.gnome.Shell"))
b31790
+                        phase = GSM_MANAGER_PHASE_DISPLAY_SERVER;
f47161
+                else if (app_id != NULL && g_str_equal (app_id, "org.gnome.SettingsDaemon.desktop"))
b31790
+                        phase = GSM_MANAGER_PHASE_INITIALIZATION;
b31790
+                else
b31790
+                        phase = GSM_MANAGER_PHASE_APPLICATION;
b31790
         }
b31790
 
b31790
         dbus_name = g_desktop_app_info_get_string (app->priv->app_info,
b31790
                                                    GSM_AUTOSTART_APP_DBUS_NAME_KEY);
b31790
         if (dbus_name != NULL) {
b31790
                 app->priv->launch_type = AUTOSTART_LAUNCH_ACTIVATE;
b31790
         } else {
b31790
                 app->priv->launch_type = AUTOSTART_LAUNCH_SPAWN;
b31790
         }
b31790
 
b31790
         /* this must only be done on first load */
b31790
         switch (app->priv->launch_type) {
b31790
         case AUTOSTART_LAUNCH_SPAWN:
b31790
                 startup_id =
b31790
                         g_desktop_app_info_get_string (app->priv->app_info,
b31790
                                                        GSM_AUTOSTART_APP_STARTUP_ID_KEY);
b31790
 
b31790
                 if (startup_id == NULL) {
b31790
                         startup_id = gsm_util_generate_startup_id ();
b31790
                 }
b31790
                 break;
b31790
         case AUTOSTART_LAUNCH_ACTIVATE:
b31790
                 startup_id = g_strdup (dbus_name);
b31790
                 break;
b31790
         default:
b31790
                 g_assert_not_reached ();
b31790
         }
b31790
 
b31790
         res = g_desktop_app_info_has_key (app->priv->app_info,
b31790
                                           GSM_AUTOSTART_APP_AUTORESTART_KEY);
b31790
-- 
b31790
2.14.3
b31790