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 642368 - add a way to autostart only for fallback
add a way to autostart only for fallback
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: 2011-02-15 12:29 UTC by Matthias Clasen
Modified: 2011-02-16 16:59 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
patch (5.44 KB, patch)
2011-02-15 16:42 UTC, Matthias Clasen
none Details | Review
working patch (6.50 KB, patch)
2011-02-15 18:47 UTC, Matthias Clasen
none Details | Review
Make the current session name a property on the session manager (6.49 KB, patch)
2011-02-16 13:59 UTC, Alexander Larsson
committed Details | Review
Support autostart conditions that depend on the current session (8.24 KB, patch)
2011-02-16 13:59 UTC, Alexander Larsson
committed Details | Review

Description Matthias Clasen 2011-02-15 12:29:00 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...
Comment 1 Matthias Clasen 2011-02-15 12:29:43 UTC
Another idea would be

OnlyShowIn=X-GNOME-fallback;

but I like that less, since conceptually, fallback is still GNOME
Comment 2 Alexander Larsson 2011-02-15 13:03:38 UTC
Can we not add them to:

DefaultApps=gnome-settings-daemon;

in gnome-fallback.session
Comment 3 Vincent Untz 2011-02-15 13:14:16 UTC
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.
Comment 4 Matthias Clasen 2011-02-15 16:42:23 UTC
Created attachment 180917 [details] [review]
patch

Here is an untested patch that adds conditions for fallback.
Comment 5 Matthias Clasen 2011-02-15 18:47:02 UTC
Created attachment 180932 [details] [review]
working patch

The first patch was missing a hunk in is_conditionally_disabled()
This version is tested and works.
Comment 6 Alexander Larsson 2011-02-16 08:21:37 UTC
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.
Comment 7 Alexander Larsson 2011-02-16 10:33:08 UTC
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.
Comment 8 Alexander Larsson 2011-02-16 13:59:47 UTC
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.
Comment 9 Alexander Larsson 2011-02-16 13:59:50 UTC
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.
Comment 10 Vincent Untz 2011-02-16 16:00:11 UTC
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;
Comment 11 Matthias Clasen 2011-02-16 16:07:50 UTC
looks good to me too.
Comment 12 Vincent Untz 2011-02-16 16:12:09 UTC
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 :-)
Comment 13 Alexander Larsson 2011-02-16 16:16:01 UTC
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