GNOME Bugzilla – Bug 663721
gnome-session no longer starts desktop files under /usr/share/gdm/autostart/LoginWindow
Last modified: 2012-09-25 17:40:09 UTC
spice-vdagent installs a /usr/share/gdm/autostart/LoginWindow/spice-vdagent.desktop file, so that the agent gets auto started in the gdm session, so that things like client mouse mode work at the login screen too. This no longer seems to work with the latest gnome-session I asked about this on irc, here are some interesting snippets from the discussion on irc: <halfline> hansg: so we needed to switch gdm over to run gnome-session in a different mode <halfline> so that we can have fallback/normal sessions <halfline> the way it works is /usr/share/gnome-session/sessions contains a list of sessions <halfline> dconf contains which session to start from there <halfline> by default we use the "gdm" session <halfline> and fall back to the "gdm-fallback" session <halfline> unfortunately, the autostart mechanism is not available when gnome-session is run in this mode <mclasen_> halfline: would it be hard to bring autostart back there ? <halfline> we could probably make gnome-session support both at the same time <halfline> vuntz: --autostart and --session don't work together right now i mean <halfline> if you do --session it ignores --autostart <vuntz> halfline: they should <vuntz> halfline: I'm actually surprised it doesn't work as I can't see a reason why it wouldn't <vuntz> halfline: so that'd be a bug <halfline> vuntz: okay, so we can just fix it to work then I guess <halfline> and then this problem will go away <halfline> vuntz: oh i got it backwards <halfline> vuntz: it's that --autostart ignores --session <halfline> see the top of gsm_session_fill() <halfline> so something like this should fix it: http://fpaste.org/yXBf/ <halfline> but <halfline> there's a more complicated question of how should autostart and session interact <halfline> given that session can fall back <halfline> and you may want to run something when not falling back (or only when falling back) <mclasen_> isn't that what we invented if-session for <mclasen_> ? <halfline> i guess we can just proclaim the autostart dir is strictly for ISVs that want to uncondtionally run <halfline> oh we have an if-session conditional in the desktop file? <halfline> AutostartCondition=GNOME3 if-session gnome-fallback <halfline> indeed <halfline> okay good enough And here is the patch from fpaste since that will likely timeout: diff --git a/gnome-session/gsm-session-fill.c b/gnome-session/gsm-session-fill.c index 61541b5..145c536 100644 --- a/gnome-session/gsm-session-fill.c +++ b/gnome-session/gsm-session-fill.c @@ -462,11 +462,6 @@ gsm_session_fill (GsmManager *manager, gboolean is_fallback; char *actual_session; - if (override_autostart_dirs != NULL) { - load_override_apps (manager, override_autostart_dirs); - return TRUE; - } - keyfile = get_session_keyfile (session, &actual_session, &is_fallback); if (!keyfile) @@ -476,7 +471,11 @@ gsm_session_fill (GsmManager *manager, g_free (actual_session); - load_standard_apps (manager, keyfile); + if (override_autostart_dirs != NULL) { + load_override_apps (manager, override_autostart_dirs); + } else { + load_standard_apps (manager, keyfile); + } g_key_file_free (keyfile);
okay note we'll need to change gdm to use --autostart again when invoking gnome-session after we land this.
Okay, reading the code again, I understand what's happening. The above patch is not enough: we need to change all the code that checks if required components (and looks for defaut providers) so that it uses the directory set in --autostart, instead of the usual autostart dirs. Or to say it otherwise, everything happening from gsm_session_fill() should happen with autostart dirs specified with the --autostart option.
well one thought... If we're saying that session files are the prescribed way for setting up sessions, and autostart dirs now are relegated to being a hook for ISVs to augment the session, then maybe autostart dirs shouldn't be able to override required components and default providers?
(In reply to comment #3) > well one thought... > > If we're saying that session files are the prescribed way for setting up > sessions, and autostart dirs now are relegated to being a hook for ISVs to > augment the session, then maybe autostart dirs shouldn't be able to override > required components and default providers? Autostart dirs can't override an explicit required component, but they can override a default provider. That's actually the main difference between "required component" and "default provider". (If this doesn't work this way, it's a bug :-))
So, orca is using autostart with an autostartcondition to launch when the screen reader switch is toggled in the shell. Therefore, we need autostart to work in the login screen session, or we'll have a broken screen reader switch in the login screen.
Created attachment 224985 [details] [review] wip patch Here is a work-in-progress. I haven't succeeded in having orca activated in the login session yet, so more work needed.
Created attachment 225088 [details] [review] Make autostart overriding more flexible This patch changes the interpretation of --autostart. Previously, when specified on the commandline, no session file was loaded at all. With this patch, we make it just override the locations that we look for autostart files in, from the default /etc/xdg/autostart /usr/share/autostart /usr/share/gnome/autostart (we still consult those directories for fulfilling .session file requirements) The goal of this is to enable gdm to use autostart in the login session, so orca can be activated.
Comment on attachment 225088 [details] [review] Make autostart overriding more flexible seems okay
Successfully tested now. Approval 1.
I'm not going to pretend to fully understand all of this code and how all the different components involved use it. The patch doesn't look obviously wrong =) If it fixes this bug, consider this a tentative +1. I don't have Orca yet in gnome-ostree =/ Will work on that...
basically before the login screen started gnome-session in failsafe mode which disabled checking autostart directories (since /etc/xdg/autostart is sysadmin controllable and we don't want random autostart things happening in the login screen). This also broke orca, which depends on autostart to function. Now we turn off failsafe mode, and instead tell gnome-session to find its autostart files in different gdm controlled directory. The one twist is, gnome-settings-daemon isn't autostarted (it's explicitly started as part of the gnome.session file), but it's installed in /etc/xdg/autostart. So the patch still looks at /etc/xdg/autostart for constructing session prerequistes, even though it doesn't use /etc/xdg/autostart for figuring out autostart files.
Attachment 225088 [details] pushed as 17b0b11 - Make autostart overriding more flexible