GNOME Bugzilla – Bug 354306
[autoaway plugin] X11 backend used when it should be gnome-screensaver's one
Last modified: 2006-09-10 11:31:37 UTC
As we can see on these bug reports: https://launchpad.net/distros/ubuntu/+source/xchat-gnome/+bug/57703 https://launchpad.net/distros/ubuntu/+source/xchat-gnome/+bug/56362 there is some problems with X11's backend. But in each case, people are using gnome-screensaver so this backend should be used. We have to find why and fix that problem.
The following algorithm is used to determine the screensaver to use: 1) If DBus is available, do a dbus call for getActive(). * If the call succeeds (i.e. we get a response), use gnome-screensaver * Else, try X11 screensaver 2) Check for the availability of the programs 'xprop' or 'xscreensaver-command', in that order * If at least one exist, use X11 screensaver * Else, use no screensaver and the plugin won't really do anything Before 1) above, autoaway sets up the dbus proxy and connects the signal handlers for the ActiveChanged signal. If this fails, 1) above will return FALSE, and autoaway will use X11 screensaver. Perhaps this is what's happening?
Created attachment 72351 [details] test program I wrote a little test program to try to understand the problem. People having probleme with the plugin, could you run it please? gcc $(pkg-config dbus-glib-1 glib-2.0 --cflags --libs) -Wall dbus.c
Created attachment 72355 [details] new test program Ok, i think i found the problem. gnome-screensaver's API recently changed and the "getActive" method was renamed to "GetActive". This new test program should be able to confirm that. Could you test please?
Created attachment 72356 [details] good test program Ooops. That's the good one.
I don't understand why it's still the bad version uploaded. The good code is here: http://cass.no-ip.com/~cassidy/files/brol/dbus.c
Ok, so how to fix that problem? - We can add a build dependency on gnome-screensaver and check the version at compil time. - We can perform a gnome-screensaver --version and use the good method according to the version. - We can try GetActive and if it fails use getActive - Other idea? There is no version key for gnome-screensaver in gconf.
(((baptiste@linbox)))-> ./a.out dbus_g_bus_get OK dbus_g_proxy_new_for_name OK dbus_g_proxy_call (getActive) failed dbus_g_proxy_call (GetActive) OK
(In reply to comment #6) > Ok, so how to fix that problem? > > - We can add a build dependency on gnome-screensaver and check the version at > compil time. > - We can perform a gnome-screensaver --version and use the good method > according to the version. > - We can try GetActive and if it fails use getActive > - Other idea? Hmm, this is what we get for relying on unstable API's :-) I say we try both GetActive and getActive for now, and then remove the deprecated call after some time. I can cook up a patch this weekend if needed, but I guess this fix is so trivial it'll be faster if someone with CVS access just make the change.
Should be fixed now. Testing with latest gnome-screensaver welcome. Sun Sep 10 13:27:43 CEST 2006 Guillaume Desmottes <cass@skynet.be> * plugins/autoaway/gscreensaver.c: - Use the new gnome-screensaver API. Bug #354306