diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2012-07-22 15:39:37 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2012-09-16 11:34:53 +0200 |
commit | 4a271908f1d46e0549a4d9bfc5d0e34266887695 (patch) | |
tree | a1c0f563ac0a02a322bc944ea3c6d0c216045763 /src/login/logind-session.c | |
parent | 49cb1ecf2d34c9be9cbdfd82246779e7be1d14d3 (diff) |
logind: redefine idleness to start at last activity
Before, after the timeout, a session would be timestamped as idle
since 'last activity' + 'idle timeout'. Now, it is timestamped as idle
since 'last activity'.
Before, after all sessions were idle, the seat would be marked with as
idle with the timestamp of the oldest idle session. Now it is
marked with the timestamp of the youngest idle session.
Both changes seem to me to be closer to natural understanding of
idleness: the time since last activity counts.
Diffstat (limited to 'src/login/logind-session.c')
-rw-r--r-- | src/login/logind-session.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 9740e23a16..f670db853c 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -738,7 +738,6 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) { char *p; struct stat st; usec_t u, n; - bool b; int k; assert(s); @@ -773,12 +772,11 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) { u = timespec_load(&st.st_atim); n = now(CLOCK_REALTIME); - b = u + IDLE_THRESHOLD_USEC < n; if (t) - dual_timestamp_from_realtime(t, u + b*IDLE_THRESHOLD_USEC); + dual_timestamp_from_realtime(t, u); - return b; + return u + IDLE_THRESHOLD_USEC < n; dont_know: if (t) |