gnome-session should not save/restore RequiredComponents (causes upgrade failure when switching to systemd startup)
It turns out that users can still enable session auto-saving (i.e. org.gnome.SessionManager auto-save-session true
). If this is done, a org.gnome.Shell.desktop
will be saved for GNOME Shell at least with non-systemd startup. If the user then upgrades, the saved .desktop
file is picked up. This causes GNOME shell to start twice, because the org.gnome.Shell.desktop
file in ~/.config/gnome-session/saved-session/
does not contain the X-GNOME-HiddenUnderSystemd=true
flag.
I believe it is wrong to ever save a RequiredComponent
like this. To fix this issue, we should both prevent saving and also loading of the corresponding .desktop
files.
i.e.:
-
Do not save RequiredComponent
s -
Ignore any .desktop
file in~/.config/gnome-session/saved-session/
for aRequiredCompnent
Example generated .desktop file:
[Desktop Entry]
Name=gnome-shell
Comment=Client 102eb1df84c7856967155381274637567800000298960000 which was automatically saved
Icon=system-run
Type=Application
StartupNotify=true
X-GNOME-Autostart-startup-id=102eb1df84c7856967155381274637567800000298960000
Exec=gnome-shell --sm-client-id 102eb1df84c7856967155381274637567800000298960000
X-GNOME-Autostart-discard-exec=rm -f /home/lvs/.config/mutter/sessions/102eb1df84c7856967155381274637567800000298960000.ms
X-GNOME-Provides=panel;windowmanager;;;;
X-GNOME-Autostart-Phase=DisplayServer
X-GNOME-AutoRestart=false