After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790913 - gnome-session needs to write out autostart phase when saving session
gnome-session needs to write out autostart phase when saving session
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-27 18:30 UTC by Ray Strode [halfline]
Modified: 2018-01-22 10:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
save: make sure app state is written into desktop file (38.18 KB, patch)
2017-11-27 20:45 UTC, Ray Strode [halfline]
committed Details | Review
save: track app store in state structure (2.76 KB, patch)
2018-01-17 15:06 UTC, Ray Strode [halfline]
committed Details | Review
save: fix use of uninitialized variable (4.39 KB, patch)
2018-01-17 15:13 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2017-11-27 18:30:34 UTC
someone at work is having issues logging into wayland. after quite a bit of digging we noticed this in his ~/.config/gnome-session/saved-sessions dir:

[Desktop Entry]
Name=gnome-shell
Comment=Client 107aadc289e46485ec150525119065205200000040350000 which was automatically saved
Icon=system-run
Type=Application
StartupNotify=true
X-GNOME-Autostart-startup-id=107aadc289e46485ec150525119065205200000040350000
Exec=gnome-shell --sm-client-id 107aadc289e46485ec150525119065205200000040350000
X-GNOME-Autostart-discard-exec=rm -f /home/simo/.config/mutter/sessions/107aadc289e46485ec150525119065205200000040350000.ms

The important thing to notice here is the lack of a:

X-GNOME-Autostart-Phase=DisplayServer

line, so gnome-shell isn't getting started first.
Comment 1 Ray Strode [halfline] 2017-11-27 20:45:31 UTC
Created attachment 364530 [details] [review]
save: make sure app state is written into desktop file

There are a number of important bits of app state written into
an applications desktop file that needs to be restored when
the session is saved.  For instance, the phase in which the client
should get started.

That state is currently stored on the GsmApp object, which is
inaccessible, from the client save function.

This commit adds the neccesary plumbing to route the GsmApp object
associated with a client to the client save function, and also
adds code to allow the app object to augment the client keyfile at
save time.
Comment 2 Ray Strode [halfline] 2017-11-27 20:47:06 UTC
Note attachment 364530 [details] [review] is a completely untested first draft.  I haven't tried it yet, so it probably needs some tweaks before it works.
Comment 3 Ray Strode [halfline] 2017-12-13 16:21:15 UTC
Attachment 364530 [details] pushed as f7ff807 - save: make sure app state is written into desktop file
Comment 4 Ray Strode [halfline] 2018-01-17 15:06:49 UTC
Created attachment 366946 [details] [review]
save: track app store in state structure

commit f7ff80775abd345a33e8a656ba019bc05e39d7bb attempts to save
GsmApp specific state during session saving, but neglects to
plumb through the app store to get to the state.

This commit fixes that.
Comment 5 Ray Strode [halfline] 2018-01-17 15:13:35 UTC
Created attachment 366947 [details] [review]
save: fix use of uninitialized variable

We're trying to access the app id before we look it up.

This commit fixes that.
Comment 6 Ray Strode [halfline] 2018-01-17 15:14:04 UTC
Attachment 366946 [details] pushed as c7f61ab - save: track app store in state structure
Attachment 366947 [details] pushed as 06ef3f7 - save: fix use of uninitialized variable