GNOME Bugzilla – Bug 692321
o.g.ScreenSaver race on startup wrt gnome-shell
Last modified: 2013-01-22 22:25:03 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().
(These criticals are visible when booting the current gnome-ostree in qemu)
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.
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.
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