GNOME Bugzilla – Bug 645539
Do not always restart saved required components
Last modified: 2021-06-14 18:22:49 UTC
Required components saved in a saved session should only be restarted if the newly started session also requires this component in some way. Example: 1) Session A requires component XYZ. Session A is saved. 2) Session B does not require component XYZ, and has nothing that conflicts (via provides) with XYZ 3) If session B starts, then XYZ is started too. Which is not wanted. How to fix this: 1) add a X-GNOME-Autostart-RequiredBySession key to saved .desktop file, with "A" (name of session) as value 2) when adding saved apps from saved session on startup, check if X-GNOME-Autostart-RequiredBySession is set. If it's set and the name is the one of the current session, use it. If it's set and the name is different, then don't use it but keep the .desktop around in case we have the same app started via autostart later on.
Note: it doesn't affect our default gnome/gnome-fallback setup because components in one conflicts with components in the other ones (shell vs panel & metacity), or are not saved anyway (notification-daemon).
One option is to change the key name we use to read/save the session; this avoids loading old saved sessions that may have e.g. metacity in them when upgrading to GNOME 3. Concretely we change in the code the return value gsm_util_get_saved_session_dir to ~/.config/gnome-session/saved-session-3 or something.
Created attachment 186754 [details] [review] patch that implements Colins proposal
(In reply to comment #3) > Created an attachment (id=186754) [details] [review] > patch that implements Colins proposal I'm fine with this; the risk of breakage seems to me to be very low, and we know reading old saved sessions causes problem.s But did you get a chance to actually test it? Someone should before we commit this. Could also use a comment in the code linking to this bug (yeah, you can git annotate, but if code moves around you have to dig harder).
Created attachment 186786 [details] [review] new patch Next iteration adds a bug ref to the code, and updates the man page to refer to the new location, too.
Review of attachment 186786 [details] [review]: This looks good to me. Would still like a comment from Vincent though too.
*** Bug 642454 has been marked as a duplicate of this bug. ***
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of gnome-session, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-session/-/issues/ Thank you for your understanding and your help.