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 589835 - Idle dectection does not work with gnome-screensaver
Idle dectection does not work with gnome-screensaver
Status: RESOLVED FIXED
Product: hamster-applet
Classification: Deprecated
Component: general
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: hamster-applet-maint
hamster-applet-maint
Depends on:
Blocks:
 
 
Reported: 2009-07-27 04:50 UTC by Rex Tsai
Modified: 2009-07-29 14:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
changed the idle checking with org.gnome.SessionManager.Presence (2.75 KB, patch)
2009-07-27 10:56 UTC, Rex Tsai
rejected Details | Review
fixed the idle time checking for newer GnomeScreenSaver and GnomeSessionManager (6.50 KB, patch)
2009-07-27 17:08 UTC, Rex Tsai
committed Details | Review

Description Rex Tsai 2009-07-27 04:50:57 UTC
In the latest version of gnome-screensaver, it's using gnome-session
idle signal instead of idle watcher[1]. 

  Which means the 3rd party software should also use gnome-session idle intend of gnome-screensaver, since gnome-screensaver no longer provides idle time.

This bug has been reported to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538790 and http://mail.gnome.org/archives/hamster-applet-devel-list/2009-July/thread.html#00000

1. http://bugzilla.gnome.org/show_bug.cgi?id=567919
Comment 1 Rex Tsai 2009-07-27 10:56:04 UTC
Created attachment 139271 [details] [review]
changed the idle checking with org.gnome.SessionManager.Presence
Comment 2 Toms Bauģis 2009-07-27 11:52:51 UTC
Your patch is introducing a regression Rex - the task should be considered stopped at the time when computer becomes idle. That is current time - configured idle minutes.
I wonder why have you ripped out the parts that were doing it.
Comment 3 Toms Bauģis 2009-07-27 11:55:11 UTC
Oh also, could you please base your patch on 2.27 branch first - the 
2.27.5 has to be rolled out today and i hope to incorporate your changes in it and that will fasten the review process.

Thank you for your work!
Comment 4 Rex Tsai 2009-07-27 17:08:40 UTC
Created attachment 139299 [details] [review]
fixed the idle time checking for newer GnomeScreenSaver and  GnomeSessionManager

Sorry, I can not find the 2_27_5 tag or branch in git repository (http://git.gnome.org/cgit/hamster-applet/). So this patch is against to master.

This version considered the stopped time when computer becomes idle. And also changed on_idle_changed as signal, to avoid race condition of dbus signal.

-Rex
Comment 5 Toms Bauģis 2009-07-27 17:56:45 UTC
Hey Rex!

git master is just fine!

It seems to me that "/desktop/gnome/session/idle_delay" key that is used to subtract idle minutes, does not correspond to the idle event. And i'm not sure what that key corresponds to.

The screensaver kicks in the time specified by "/apps/gnome-screensaver/idle_delay" and so is the idle event.

Also i'm somewhat confused now - are we back to listening to screensaver events? From the fixes in idle.py it sure looks so.
Comment 6 Rex Tsai 2009-07-28 03:52:26 UTC
Hi,

From my study, 

1. /apps/gnome-screensaver/idle_delay is no longer used in gnome-screensaver 2.26.1-2. In fact, if you changed the gnome-screensaver idle time setting, it changed to /desktop/gnome/session/idle_delay, not /apps/gnome-screensaver/idle_delay now.

2. gnome-session fired StatusChanged event, when the /desktop/gnome/session/idle_delay (in minutes) is dued.

 path=/org/gnome/SessionManager/Presence; interface=org.gnome.SessionManager.Presence; member=StatusChanged

3. gnome-screensaver fired ActiveChanged, when it received StatusChanged from gnome-session. (gnome-screensaver/src/gs-watcher-x11.c)

path=/org/gnome/ScreenSaver; interface=org.gnome.ScreenSaver; member=ActiveChanged

4. So, for hamster, we can use either StatusChanged (gnome-session) or ActiveChanged (gnome-screensaver). However, the gnome-session does not store the idle time.

regards
-Rex
Comment 7 Rex Tsai 2009-07-28 03:55:34 UTC
  Oh, the reason I like to monitor org.gnome.ScreenSaver, it's because it tells both ActiveChanged and Lock signals.

  From gnome-session, I only know it's idle don't know if it's because the user launch the screensaver.

regards
-Rex
Comment 8 Toms Bauģis 2009-07-29 14:10:03 UTC
Finally I could verify the bug by installing ubuntu's karmic koala version on virtual box.

Cleaned the code up some more and implemented a fix that works on both solutions. It's based on somewhat hackish duck typing.
Bug has been solved in git master.


Thank you very much for the report and patch.