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 320223 - DBus method getIdleTime not working
DBus method getIdleTime not working
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: general
0.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-30 10:21 UTC by Isak Savo
Modified: 2005-12-19 01:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Isak Savo 2005-10-30 10:21:50 UTC
Version details: 0.0.15
Distribution/Version: Ubuntu Breezy

It seems that the idle time reported by gnome-screensaver, for instance using
"sleep 10 && dbus-send --session --print-reply --dest=org.gnome.screensaver
--type=method_call /org/gnome/screensaver org.gnome.screensaver.getIdleTime"

doesn't work. It always returns zero, even though the session is idle. And yes,
I don't touch the computer during the 10 seconds sleep until the command returns.

I have also written a c-program that connects to the bus, and runs the dbus
method call with the same result.

This is on Ubuntu Breezy, using the pre-packaged 0.0.15 release. If you think
that it has been fixed in later versions, let me know and I will try to compile
from source.
Comment 1 William Jon McCann 2005-10-31 14:40:31 UTC
The way it works right now is that it returns zero until the screensaver detects
idleness (the length of the period of inactivity is set by the user).  When the
session goes idle a dbus message is sent (ActiveChanged with argument TRUE) over
the session bus.  After that the getIdleTime method will return non-zero values.

This is partly to discourage polling of getIdleTime and to encourage watching
for the ActiveChanged signal.

Would this work for your use?
Comment 2 Isak Savo 2005-11-03 12:59:22 UTC
Maybe, I'm still waiting for input from the xchat-gnome maintainer (see bug
#313016 ), if he decides that idle-time tracking is uneccessary, then I won't
need it I guess.

However, you may want to consider either removing or renaming this method since
it gives a false impression of what is possible to do[1]. In either case, could
you put a short note about this in the DBUS-API.txt-file to avoid this kind of
confusion?

[1] At least if one defines "idle" as "not doing anything with the computer"
which I do.
Comment 3 Isak Savo 2005-11-13 22:34:26 UTC
After some thought and patch iterations on bug #313016, I won't be needing
idle-time from gnome-screensaver. Feel free to close this as WONTFIX...
Comment 4 William Jon McCann 2005-12-19 01:16:55 UTC
I've renamed getIdleTime to getActiveTime now since it really tells how long the screensaver has been active.  There was also a bug that made getIdleTime return bogus times.  This should be fixed now.