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 636229 - [PATCH] add IsSessionRunning() method call to complement SessionRunning signal
[PATCH] add IsSessionRunning() method call to complement SessionRunning signal
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-12-01 16:41 UTC by Dan Williams
Modified: 2011-08-27 04:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add IsSessionRunning() method to complement SessionRunning signal (2.29 KB, patch)
2010-12-01 16:42 UTC, Dan Williams
accepted-commit_now Details | Review
Add an IsSessionRunning method (2.96 KB, patch)
2011-08-27 04:41 UTC, Matthias Clasen
committed Details | Review
Silence a compiler warning (822 bytes, patch)
2011-08-27 04:41 UTC, Matthias Clasen
committed Details | Review

Description Dan Williams 2010-12-01 16: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.
Comment 1 Dan Williams 2010-12-01 16:42:58 UTC
Created attachment 175631 [details] [review]
Add IsSessionRunning() method to complement SessionRunning signal
Comment 2 Vincent Untz 2010-12-01 16:54:30 UTC
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?
Comment 3 Dan Williams 2010-12-01 18:02:57 UTC
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 4 Vincent Untz 2010-12-07 09:26:16 UTC
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!
Comment 5 Matthias Clasen 2011-08-27 04:41:35 UTC
The following fixes have been pushed:
b59d358 Add an IsSessionRunning method
592963b Silence a compiler warning
Comment 6 Matthias Clasen 2011-08-27 04:41:39 UTC
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,
Comment 7 Matthias Clasen 2011-08-27 04:41:41 UTC
Created attachment 194900 [details] [review]
Silence a compiler warning