Re: Signalling when the desktop is loaded



On Tue, 2009-08-11 at 11:55 -0500, Cody Russell wrote:
> Hello,
> 
> So I was talking briefly to vuntz in irc yesterday about wanting to have
> some kind of mechanism to find out when the desktop session is ready
> (ie, not once Nautilus and panel are launched, but when they are
> actually pretty usable and done loading stuff).
> 
> In terms of the panel, vuntz suggested maybe adding a signal in
> panel_applet_queue_initial_unhide_toplevels() under org.gnome.Panel.
> 
> In Nautilus there is FMDesktopIconView "end_loading" signal that seems
> to work well.
> 
> It would be nice to have a single signal that could be emitted once both
> of these are finished, so I wanted to post here and see what others
> think and get suggestions on where this might be done.
> 
> / Cody
> 
> _______________________________________________
> desktop-devel-list mailing list
> desktop-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/desktop-devel-list
Hi,

It seems this thread has gnome slightly off-topic a bit now, but I'll
try to steer it back on-topic with a suggestion of my own.

First of all, let me explain the reason for starting this thread and
what is currently happening in Ubuntu. This will allow me to explain the
problems with the current implementation in Ubuntu, and the reasoning
behind my suggestion. Cody - please correct me if any of my details are
wrong / out-of-date, as you are much closer to this than I am.

Cody has been working on some software called xsplash. I think the idea
is that it will show a full-screen splash image when logging in via GDM,
and the splash image will not disappear until the desktop has finished
loading (and is ready to use). This should look visually appealing, as
it should hide things like panel applets loading (at least that is my
understanding of it) and make the transition from GDM to desktop really
smooth. This necessitates the need to know when various desktop
components are ready to use though.

The way that this is currently done in Ubuntu is by patching gnome-panel
and nautilus to signal to xsplash over dbus when they are finished
loading and ready to use. Xsplash will only disappear when both of these
components are ready, or a timeout occurs. The shortfalls of this
implementation are:

- Some users may not be using gnome-panel or nautilus (or both), or may
not use nautilus to draw the desktop. gnome-session allows you to choose
to not start these components (or swap them for something else), so this
case should be handled gracefully without breakage. This is currently
worked around by a 10 second timeout in xsplash, but it means that the
splash image could be displayed for a long time after the session is
really ready to use.

- If somebody else wants to patch their application to work with
xsplash, then xsplash must also be updated to become aware of this
application so that it waits for it to finish loading before displaying
the desktop. If a user decides not to use this new component, they will
hit the same issue mentioned above. So, the current implementation is
not particularly scalable.

My suggestion for this is based on gnome-session sending out a signal
over DBus when the session transitions to "Running" (doesn't it do this
already?)

Xsplash should listen out for this signal, and show the desktop when it
sees it. Currently, gnome-session will transition from "Application"
phase to "Running" phase an arbitrary amount of time after autostarting
all of the applications in the application phase, or after a timeout (10
seconds?) - so there is no guarantee that the desktop is ready to use
when this signal is emitted. My suggestion is based on providing an API
in gnome-session to allow autostart applications to "stall" the
transition to the "Running" phase until they are really finished
loading. The autostart applications (eg, gnome-panel and nautilus)
should signal to the session manager that they wish to stall the
transition to "Running" straight after registering with it. Then, they
will signal to the session manager later on when they are ready to use.
Only when all applications who asked to "stall" the transition have
signalled that they are ready, will gnome-session then transition to
"Running" and emit a signal that the session is now running.

This addresses both of the above shortfalls:

- If a user chooses not to use the default components which support
stalling the session (gnome-panel or nautilus), then the implementation
will fail gracefully by transitioning to "Running" when all autostart
applications have loaded and registered (as is the case now). This would
avoid the current timeout in xsplash to deal with this issue, although
the user experience would be slightly degraded by using desktop
components that don't support it.

- A developer can add support for this mechanism to their application
without having to also patch xsplash to make it aware of this new
application. For example, gnome-volume-control-applet could be patched
to ensure that xsplash doesn't disappear until it has finished loading,
without having to make xsplash aware of it (I'm not suggesting that the
splash should wait for g-v-c-applet to load by the way - I just used
that as an example). Therefore, the solution is more scalable.

Anyway, please let me know what you think, or of any issues you can see
with an implementation like that. And I hope it starts some discussion
on the original question :)

Regards
Chris



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]