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 692321 - o.g.ScreenSaver race on startup wrt gnome-shell
o.g.ScreenSaver race on startup wrt gnome-shell
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2013-01-22 19:46 UTC by Colin Walters
Modified: 2013-01-22 22:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Avoid possible criticals on startup (4.79 KB, patch)
2013-01-22 21:51 UTC, Bastien Nocera
committed Details | Review

Description Colin Walters 2013-01-22 19:46:23 UTC
gnome-shell and g-s-d are started at the same time.

gnome-shell exports o.g.ScreenSaver, but does not install a DBus activation file for it.  

g-s-d creates a proxy for o.g.ScreenSaver, which doesn't exist yet and isn't activatable, so emits a various criticals.

g-s-d should probably be using g_bus_watch_name().
Comment 1 Colin Walters 2013-01-22 19:46:44 UTC
(These criticals are visible when booting the current gnome-ostree in qemu)
Comment 2 Bastien Nocera 2013-01-22 21:51:24 UTC
Created attachment 234144 [details] [review]
power: Avoid possible criticals on startup

The screensaver (gnome-shell) might not be ready when we start up,
which would mean ending up without a working screensaver proxy,
or gnome-shell might restart, making our proxy invalid.

Ensure that doesn't happen by watching the screensaver name.
Comment 3 Colin Walters 2013-01-22 22:02:30 UTC
Review of attachment 234144 [details] [review]:

One style thing, but looks right to me.

::: plugins/power/gsd-power-manager.c
@@ +3428,3 @@
                                   GS_DBUS_NAME,
+                                  G_BUS_NAME_WATCHER_FLAGS_NONE,
+                                  (GBusNameAppearedCallback) screensaver_appeared_cb,

Pure coding style thing - it's your project, but nowadays I tend to never cast callbacks if I can avoid it.  Been burned one too many times by turning some function that returns void into an idle callback and wondering why it's getting rescheduled...

If you don't cast the function address, use "gpointer user_data" in the signature and then do:

MyData *data = user_data;

you get a warning.
Comment 4 Bastien Nocera 2013-01-22 22:24:56 UTC
I actually prefer when we don't have to cast again in the callback so that I know the expected type of the user_data at a glance.

Attachment 234144 [details] pushed as f3106a7 - power: Avoid possible criticals on startup