summaryrefslogtreecommitdiff
path: root/Xext/sync.c
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <christopher.halse.rogers@canonical.com>2010-12-06 11:24:01 +1100
committerKeith Packard <keithp@keithp.com>2010-12-19 16:43:42 -0800
commita2e67a6412386782cb8b644b86a5744591397d45 (patch)
treef337c223a82a48767d41184ae09754ef98091256 /Xext/sync.c
parentb55bf248581dc66321b24b29f199f6dc8d02db1b (diff)
IDLETIME: Fix edge-case in IdleTimeBlockHandler
Ensure that if we're called exactly on the threshold of a NegativeTransition trigger that we reshedule to pick up an idle time over the threshold. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xext/sync.c')
-rw-r--r--Xext/sync.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index 7ea8a44fa..d495116dc 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -2793,6 +2793,14 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
break;
}
}
+ /*
+ * We've been called exactly on the idle time, but we have a
+ * NegativeTransition trigger which requires a transition from an
+ * idle time greater than this. Schedule a wakeup for the next
+ * millisecond so we won't miss a transition.
+ */
+ if (XSyncValueEqual (idle, *pIdleTimeValueLess))
+ AdjustWaitForDelay(wt, 1);
}
else if (pIdleTimeValueGreater)
{