summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-01 00:34:18 -0700
committerKeith Packard <keithp@keithp.com>2013-11-01 00:34:18 -0700
commit977e2644b1d9e13b44debcb9a372bbc832ee32a3 (patch)
tree9bff1a4713fc814585ebb60b3ff67a8624484967 /Xext
parent66c5ee0ff4690e630a69656331fd9d545c99c26c (diff)
parentf36f5a65f639b6524191d888d5bf89e73027156c (diff)
Merge remote-tracking branch 'whot/for-keith'
Diffstat (limited to 'Xext')
-rw-r--r--Xext/sync.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index 126ce43a1..a04c38388 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -2682,7 +2682,16 @@ IdleTimeBlockHandler(pointer pCounter, struct timeval **wt, pointer LastSelectMa
IdleTimeQueryValue(counter, &idle);
counter->value = idle; /* push, so CheckTrigger works */
- if (less && XSyncValueLessOrEqual(idle, *less)) {
+ /**
+ * There's an indefinite amount of time between ProcessInputEvents()
+ * where the idle time is reset and the time we actually get here. idle
+ * may be past the lower bracket if we dawdled with the events, so
+ * check for whether we did reset and bomb out of select immediately.
+ */
+ if (less && XSyncValueGreaterThan(idle, *less) &&
+ LastEventTimeWasReset(priv->deviceid)) {
+ AdjustWaitForDelay(wt, 0);
+ } else if (less && XSyncValueLessOrEqual(idle, *less)) {
/*
* We've been idle for less than the threshold value, and someone
* wants to know about that, but now we need to know whether they