aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/packages/rpm/sle11/SOURCES/sync-fix.patch
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-03-19 14:03:53 +0000
committerPierre Ossman <ossman@cendio.se>2014-03-19 14:03:53 +0000
commit604648da116336a299bd9ff21f9c32c9b401a5c4 (patch)
tree65ee74ba58b02bbcdd2f5b8622efe168e7ab83cc /contrib/packages/rpm/sle11/SOURCES/sync-fix.patch
parent266eec4ecf338f3f08771f8dfe79dbd5d9da00a1 (diff)
downloadtigervnc-1.3.1.tar.gz
tigervnc-1.3.1.zip
Backport the contrib directory from trunk as well as our new buildv1.3.11.3-branch
system relies on it. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_3@5173 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'contrib/packages/rpm/sle11/SOURCES/sync-fix.patch')
-rw-r--r--contrib/packages/rpm/sle11/SOURCES/sync-fix.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/contrib/packages/rpm/sle11/SOURCES/sync-fix.patch b/contrib/packages/rpm/sle11/SOURCES/sync-fix.patch
new file mode 100644
index 00000000..3a2ddc4e
--- /dev/null
+++ b/contrib/packages/rpm/sle11/SOURCES/sync-fix.patch
@@ -0,0 +1,57 @@
+--- xorg-server-1.9.1/Xext/sync.c 2010-11-16 23:11:56.751124639 -0500
++++ xorg-server-1.9.1/Xext/sync.c 2010-11-16 23:13:16.327862535 -0500
+@@ -2264,8 +2264,44 @@
+ static void
+ IdleTimeQueryValue (pointer pCounter, CARD64 *pValue_return)
+ {
+- CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
++ static CARD32 previousLastDeviceEventTimeMilliseconds = 0;
++ CARD32 now = GetTimeInMillis();
++ CARD32 idle = now - lastDeviceEventTime.milliseconds;
++ CARD32 previousIdle = now - previousLastDeviceEventTimeMilliseconds;
++ SyncCounter *pIdleTimeCounter = (SyncCounter*)pCounter;
++
+ XSyncIntsToValue (pValue_return, idle, 0);
++
++ if (pCounter == NULL)
++ {
++ return;
++ }
++ if (previousLastDeviceEventTimeMilliseconds == 0)
++ {
++ /* initialize static var when this function is invoked the first time. */
++ previousLastDeviceEventTimeMilliseconds = lastDeviceEventTime.milliseconds;
++ return;
++ }
++
++ if (previousLastDeviceEventTimeMilliseconds == lastDeviceEventTime.milliseconds)
++ {
++ /* no new user event, no need to change idle counter. */
++ return;
++ }
++ previousLastDeviceEventTimeMilliseconds = lastDeviceEventTime.milliseconds;
++
++ /*
++ * Some user event occured; now update idle counter with previous
++ * event time, so idle counter has the most up-to-date value with
++ * respect to previous user event (we need old and new counter
++ * value to compute if a transition occured). Recompute bracket
++ * values if this is system counter.
++ */
++
++ XSyncIntsToValue (&pIdleTimeCounter->value, previousIdle, 0);
++ if (IsSystemCounter(pIdleTimeCounter)) {
++ SyncComputeBracketValues(pIdleTimeCounter);
++ }
+ }
+
+ static void
+@@ -2342,7 +2378,7 @@
+ if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
+ return;
+
+- IdleTimeQueryValue (NULL, &idle);
++ IdleTimeQueryValue (IdleTimeCounter, &idle);
+
+ if ((pIdleTimeValueGreater &&
+ XSyncValueGreaterOrEqual (idle, *pIdleTimeValueGreater)) ||