Merge lp:~vanvugt/compiz/fix-1009338 into lp:compiz/0.9.8

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3245
Merged at revision: 3246
Proposed branch: lp:~vanvugt/compiz/fix-1009338
Merge into: lp:compiz/0.9.8
Diff against target: 45 lines (+6/-4)
2 files modified
plugins/composite/composite.xml.in (+1/-1)
plugins/composite/src/screen.cpp (+5/-3)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1009338
Reviewer Review Type Date Requested Status
Sam Spilsbury Approve
Review via email: mp+108888@code.launchpad.net

Description of the change

Fall back to a refresh rate that is more likely to look correct; 60Hz.
(LP: #1009338)

The fallback is still only used if sync-to-vblank is not available (disabled
in the driver) AND if xrandr doesn't provide a refresh rate.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Approve, please change

+#define FALLBACK_REFRESH_RATE 60 /* if all else fails */

To

static const unsigned int FALLBACK_REFRESH_RATE = 60

review: Approve
lp:~vanvugt/compiz/fix-1009338 updated
3246. By Daniel van Vugt

Stylistic request to avoid macros.

Though doing so does have the added benefit of generating a symbol you can
see in a debugger.

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/composite/composite.xml.in'
2--- plugins/composite/composite.xml.in 2012-06-05 07:40:03 +0000
3+++ plugins/composite/composite.xml.in 2012-06-06 07:36:39 +0000
4@@ -16,7 +16,7 @@
5 <option name="refresh_rate" type="int">
6 <_short>Refresh Rate</_short>
7 <_long>The rate at which the screen is redrawn (times/second)</_long>
8- <default>50</default>
9+ <default>60</default>
10 <min>1</min>
11 <max>200</max>
12 </option>
13
14=== modified file 'plugins/composite/src/screen.cpp'
15--- plugins/composite/src/screen.cpp 2012-06-06 05:12:28 +0000
16+++ plugins/composite/src/screen.cpp 2012-06-06 07:36:39 +0000
17@@ -45,6 +45,8 @@
18
19 #include <core/timer.h>
20
21+static const int FALLBACK_REFRESH_RATE = 60; /* if all else fails */
22+
23 CompWindow *lastDamagedWindow = 0;
24
25 void
26@@ -274,8 +276,8 @@
27 exposeRects (),
28 windowPaintOffset (0, 0),
29 overlayWindowCount (0),
30- redrawTime (1000 / 50),
31- optimalRedrawTime (1000 / 50),
32+ redrawTime (1000 / FALLBACK_REFRESH_RATE),
33+ optimalRedrawTime (1000 / FALLBACK_REFRESH_RATE),
34 scheduled (false),
35 painting (false),
36 reschedule (false),
37@@ -651,7 +653,7 @@
38 }
39
40 if (value.i () == 0)
41- value.set ((int) 50);
42+ value.set ((int) FALLBACK_REFRESH_RATE);
43
44 mOptions[CompositeOptions::DetectRefreshRate].value ().set (false);
45 screen->setOptionForPlugin ("composite", "refresh_rate", value);

Subscribers

People subscribed via source and target branches