GNOME Bugzilla – Bug 692395
Reduce idle-watch movement
Last modified: 2013-01-23 15:58:02 UTC
.
Created attachment 234212 [details] [review] presence: Add better debug
Created attachment 234213 [details] [review] presence: Try to keep the same idle watch There's no reason for us to destroy and re-create idle watches with the same values if the length of the idle timeout, or the fact that we're inhibited doesn't change.
Created attachment 234214 [details] [review] presence: Handle really short idle delays We wouldn't end up idle in the following scenario: idle-delay = 10 secs we've been idle for 7 secs idle-delay = 5 secs idle time is 7 secs, but our idle watch is for 5 seconds. We handle this by manually checking for the idle time. In the case of a race where the idle time might be triggered twice, it would not have any adverse effects as set_session_idle() knows we're already idle.
Review of attachment 234212 [details] [review]: OK.
Review of attachment 234213 [details] [review]: Looks OK too.
Review of attachment 234214 [details] [review]: ::: gnome-session/gsm-presence.c @@ +182,3 @@ + + /* If the idle-delay is really short, we might end up with + * the idletime already being past the timeout */ I thought about triggering this immediately in this case for the new GnomeIdleMonitor API, but let's handle that when we get there.
(In reply to comment #6) > Review of attachment 234214 [details] [review]: > > ::: gnome-session/gsm-presence.c > @@ +182,3 @@ > + > + /* If the idle-delay is really short, we might end up with > + * the idletime already being past the timeout */ > > I thought about triggering this immediately in this case for the new > GnomeIdleMonitor API, but let's handle that when we get there. I'm not sure we want to do that in 100% of the cases where it happens though.
Attachment 234212 [details] pushed as a64d01d - presence: Add better debug Attachment 234213 [details] pushed as abf4058 - presence: Try to keep the same idle watch Attachment 234214 [details] pushed as 4a2c332 - presence: Handle really short idle delays