From 90210263eba8ea2fa02fc7d55224d56552de6840ec563bcc5de6941efc7a6af9 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Sun, 19 Dec 2010 23:33:09 +0000 Subject: [PATCH] - sync-fix.patch * fixes the issue that gnome screensaver fadeout could not be stopped (bnc #648851) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=313 --- sync-fix.patch | 57 +++++++++++++++++++++++++++++++++++++++++ xorg-x11-server.changes | 7 +++++ xorg-x11-server.spec | 2 ++ 3 files changed, 66 insertions(+) create mode 100644 sync-fix.patch diff --git a/sync-fix.patch b/sync-fix.patch new file mode 100644 index 0000000..741a8a2 --- /dev/null +++ b/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)) || diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index c22aeb8..b4b76c8 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Dec 19 23:23:30 UTC 2010 - sndirsch@novell.com + +- sync-fix.patch + * fixes the issue that gnome screensaver fadeout could not be + stopped (bnc #648851) + ------------------------------------------------------------------- Sun Dec 19 14:57:16 UTC 2010 - sndirsch@novell.com diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index e1acf0c..e11629d 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -118,6 +118,7 @@ Patch217: CVE-2010-2240-address_space_limit.patch Patch218: CVE-2010-2240-tree_depth_limit.patch Patch220: Use-external-tool-for-creating-backtraces-on-crashes.patch Patch221: commit-5c6a2f9.diff +Patch222: sync-fix.patch %if %moblin Patch300: moblin-use_preferred_mode_for_all_outputs.diff %endif @@ -246,6 +247,7 @@ popd %patch218 -p1 %patch220 -p1 %patch221 -p1 +%patch222 -p1 %if %moblin %patch300 -p1 %endif