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 692395 - Reduce idle-watch movement
Reduce idle-watch movement
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other All
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-23 15:02 UTC by Bastien Nocera
Modified: 2013-01-23 15:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
presence: Add better debug (2.88 KB, patch)
2013-01-23 15:02 UTC, Bastien Nocera
committed Details | Review
presence: Try to keep the same idle watch (2.61 KB, patch)
2013-01-23 15:02 UTC, Bastien Nocera
committed Details | Review
presence: Handle really short idle delays (1.75 KB, patch)
2013-01-23 15:02 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2013-01-23 15:02:37 UTC
.
Comment 1 Bastien Nocera 2013-01-23 15:02:39 UTC
Created attachment 234212 [details] [review]
presence: Add better debug
Comment 2 Bastien Nocera 2013-01-23 15:02:41 UTC
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.
Comment 3 Bastien Nocera 2013-01-23 15:02:44 UTC
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.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-01-23 15:31:39 UTC
Review of attachment 234212 [details] [review]:

OK.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-01-23 15:31:50 UTC
Review of attachment 234213 [details] [review]:

Looks OK too.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-01-23 15:33:22 UTC
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.
Comment 7 Bastien Nocera 2013-01-23 15:52:27 UTC
(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.
Comment 8 Bastien Nocera 2013-01-23 15:57:54 UTC
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