GNOME Bugzilla – Bug 642368
add a way to autostart only for fallback
Last modified: 2011-02-16 16:59:56 UTC
We have a number of things that are obsoleted for gnome3, but still needed for the fallback session: ‣ gnome-sound-applet ‣ nm-applet ‣ polkit-gnome-authentication-agent ‣ bluetooth-applet Currently we have no way to autostart these only for a fallback session, and we need one. Alternatives are something like a new autostart condition AutostartCondition=is-fallback-session or AutostartCondition=SESSION fallback or use an existing mechanism like AutostartCondition=if-exists ~/.config/gnome-session/is-fallback but that could run into tricky timing issues with creating/removing that file...
Another idea would be OnlyShowIn=X-GNOME-fallback; but I like that less, since conceptually, fallback is still GNOME
Can we not add them to: DefaultApps=gnome-settings-daemon; in gnome-fallback.session
This would work, sure, but this implies that we know of all desktop files that are in this case, and that we keep the list up-to-date. A bit too painful, imho.
Created attachment 180917 [details] [review] patch Here is an untested patch that adds conditions for fallback.
Created attachment 180932 [details] [review] working patch The first patch was missing a hunk in is_conditionally_disabled() This version is tested and works.
Thats not quite right. SessionManager.fallback is true only if we used the fallback from the default session (i.e. fall back from gnome to gnome-fallback). If the user has configured the default session to be "gnome-fallback" then this will not work. I guess we have to add an "active session name" property on SessionManager.
Also, i'm not sure we should add non-prefixed public autostartconditions like that (see http://lists.freedesktop.org/archives/xdg/2007-January/007436.html). What about AutostartCondition=GNOME3 is-session gnome-fallback and AutostartCondition=GNOME3 unless-session gnome That properly scopes the key as gnome specific, without affecting the old GNOME prefix that means "read from gconf". It also handles the case where we fell back as well as when gnome-fallback was explicitly selected.
Created attachment 180995 [details] [review] Make the current session name a property on the session manager This way this is introspectable via dbus, and its also useful internally as a change notification if it changes at runtime.
Created attachment 180996 [details] [review] Support autostart conditions that depend on the current session autostart desktop files can add for example: AutostartCondition=GNOME3 is-session gnome-fallback or AutostartCondition=GNOME3 unless-session gnome To start only under a specific session. The GNOME3 prefix is to make it desktop specific as per the autostart spec. Unfortunately GNOME means a gconf key for historical reasons.
Review of attachment 180995 [details] [review]: Thanks, tiny nitpick below; but please commit! ::: gnome-session/gsm-session-fill.c @@ +361,3 @@ static GKeyFile * get_session_keyfile (const char *session, + char **actual_session, Tiny nitpick: char **actual_session;
looks good to me too.
Review of attachment 180996 [details] [review]: Thanks, this looks good. I was trying to find a better prefix than GNOME3, but I have no imagination and I'm not sure it matters much anyway... ::: gnome-session/gsm-autostart-app.c @@ +541,3 @@ + + /* get the singleton */ + manager = gsm_manager_new (NULL, FALSE); Can you add a gsm_manager_get() method to get the singleton? It'll just makes me feel safer :-)
Attachment 180995 [details] pushed as 3de35f6 - Make the current session name a property on the session manager Attachment 180996 [details] pushed as 58ebdfa - Support autostart conditions that depend on the current session