summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher James Halse Rogers <christopher.halse.rogers@canonical.com>2010-12-06 11:24:01 +1100
committerJeremy Huddleston <jeremyhu@apple.com>2010-12-21 10:51:04 -0800
commit11696bb133a5039e51329514377eee6a2cc8dd5a (patch)
tree2ec3bb915fccc49bd5b004b018dcfd41d25dfde0
parent625cb4c14242c3d186ec52425e7c009456eb029b (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> (cherry picked from commit a2e67a6412386782cb8b644b86a5744591397d45)
-rw-r--r--Xext/sync.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Xext/sync.c b/Xext/sync.c
index c00e692eb..314b63e98 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -2322,6 +2322,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)
{