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 354306 - [autoaway plugin] X11 backend used when it should be gnome-screensaver's one
[autoaway plugin] X11 backend used when it should be gnome-screensaver's one
Status: RESOLVED FIXED
Product: xchat-gnome
Classification: Other
Component: general
HEAD
Other Linux
: Normal normal
: ---
Assigned To: xchat-gnome maintainers
xchat-gnome maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-04 16:36 UTC by Guillaume Desmottes
Modified: 2006-09-10 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (931 bytes, text/plain)
2006-09-06 21:45 UTC, Guillaume Desmottes
Details
new test program (931 bytes, text/plain)
2006-09-06 22:20 UTC, Guillaume Desmottes
Details
good test program (931 bytes, text/plain)
2006-09-06 22:30 UTC, Guillaume Desmottes
Details

Description Guillaume Desmottes 2006-09-04 16:36:33 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.
Comment 1 Isak Savo 2006-09-04 19:03:55 UTC
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?
Comment 2 Guillaume Desmottes 2006-09-06 21:45:31 UTC
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
Comment 3 Guillaume Desmottes 2006-09-06 22:20:30 UTC
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?
Comment 4 Guillaume Desmottes 2006-09-06 22:30:00 UTC
Created attachment 72356 [details]
good test program

Ooops.
That's the good one.
Comment 5 Guillaume Desmottes 2006-09-06 22:35:10 UTC
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
Comment 6 Guillaume Desmottes 2006-09-07 19:18:04 UTC
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.
Comment 7 Baptiste Mille-Mathias 2006-09-07 20:17:56 UTC
(((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
Comment 8 Isak Savo 2006-09-07 21:18:50 UTC
(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.
Comment 9 Guillaume Desmottes 2006-09-10 11:31:37 UTC
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