GNOME Bugzilla – Bug 636229
[PATCH] add IsSessionRunning() method call to complement SessionRunning signal
Last modified: 2011-08-27 04:41:41 UTC
If a client happens to miss the SessionRunning signal, there's no way to figure out whether or not the session is running. This happened with gnome-settings-daemon during login when show-desktop-icons was true, but nautilus did not get autostarted, leading to no desktop background. It's a pretty clear race here, so we need to provide an explicit getter for the information that SessionRunning conveys in case the client isn't fast enough.
Created attachment 175631 [details] [review] Add IsSessionRunning() method to complement SessionRunning signal
Looks good, but I wonder: maybe we want to actually have a GetCurrentPhase method. For example, the Setenv method can only be used during the initialization phase, and people might want to check that. Any opinion about that?
I have no opinion really, but if we did that, then we should really have a generic PhaseChanged signal too. But in the end, while this is a real race, the gnome-settings-daemon issue got magically fixed by converting the hand-rolled libdbus signal filter code to GDBus. So this patch is no longer strictly required, but is still "correct".
Comment on attachment 175631 [details] [review] Add IsSessionRunning() method to complement SessionRunning signal Thinking about it, there's no reason an app should care about other phases. Please commit, thanks!
The following fixes have been pushed: b59d358 Add an IsSessionRunning method 592963b Silence a compiler warning
Created attachment 194899 [details] [review] Add an IsSessionRunning method This gives clients who missed the SessionRunning signal a chance to find out if the session has entered the running phase, and lets us avoid race conditions. Patch by Dan Williams,
Created attachment 194900 [details] [review] Silence a compiler warning