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 764379 - main: fix starting gnome session via startx
main: fix starting gnome session via startx
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-30 17:13 UTC by Andreas Henriksson
Modified: 2016-03-31 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: fix starting gnome session via startx (1.79 KB, patch)
2016-03-30 17:13 UTC, Andreas Henriksson
accepted-commit_now Details | Review

Description Andreas Henriksson 2016-03-30 17:13:22 UTC
The changes related to gsm_util_setenv during 3.19.x seems to have
broken starting a gnome desktop the old fashioned way, eg. via startx.

The gnome.session required components has OnlyShowIn=GNOME; which
disqualifies them from being started unless XDG_CURRENT_DESKTOP is also
set to GNOME (by the gio utility function used to look up info).

Currently gnome-session already carries code to catch the case of
XDG_CURRENT_DESKTOP being unset and set it to GNOME as a fallback.
Unfortunately the changes to gsm_util_setenv seems to have made it only
set the values in the (dbus activated) child environment, rather than
the current environment which g_desktop_app_info_get_show_in is looking
at.

Make the fallback code set XDG_CURRENT_DESKTOP in both current
and child environment fixes it.
Comment 1 Andreas Henriksson 2016-03-30 17:13:25 UTC
Created attachment 325035 [details] [review]
main: fix starting gnome session via startx
Comment 2 Ray Strode [halfline] 2016-03-30 19:05:39 UTC
Review of attachment 325035 [details] [review]:

This is fine, but to be strictly safe, we shouldn't be calling setenv after gio has initialized since it starts worker threads that potentially use gettext (which uses getenv, which isn't thread safe).

Can you commit this with a tiny tweak to move it above initialize_gio ?
Comment 3 Andreas Henriksson 2016-03-31 08:15:00 UTC
Hello Ray!

(In reply to Ray Strode [halfline] from comment #2)
[...]
> Can you commit this with a tiny tweak to move it above initialize_gio ?

Thanks for your quick review. I've updated the patch ackording to your suggestion, tested it and pushed to master and gnome-3-20 branches.

Regards,
Andreas Henriksson

https://git.gnome.org/browse/gnome-session/commit/?id=890a797a2b6c26e752fa74a09d9521bea913c621