Merge lp:~sjakthol/compiz/fix-fade-damaging into lp:compiz/0.9.10

Proposed by Sami Jaktholm
Status: Merged
Approved by: Stephen M. Webb
Approved revision: 3721
Merged at revision: 3721
Proposed branch: lp:~sjakthol/compiz/fix-fade-damaging
Merge into: lp:compiz/0.9.10
Diff against target: 16 lines (+2/-2)
1 file modified
plugins/fade/src/fade.cpp (+2/-2)
To merge this branch: bzr merge lp:~sjakthol/compiz/fix-fade-damaging
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Stephen M. Webb Approve
MC Return Approve
Review via email: mp+164888@code.launchpad.net

Commit message

Fade: Fix a typo that causes fade to constantly damage windows with a modified
      saturation.

Description of the change

What happens:
1) (Original) saturation is stored in newSaturation
2) saturation is updated
3) newSaturation (which was original saturation) is copied to saturation

In the end both saturation and newSaturation have the same value (the initial saturation). If an another plugin had changed the saturation, fAttrib.saturation != newSaturation and fade damages the window.

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

LGTM.
+1. Great.

review: Approve
Revision history for this message
Stephen M. Webb (bregma) wrote :

Nice catch.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/fade/src/fade.cpp'
2--- plugins/fade/src/fade.cpp 2013-05-09 13:43:07 +0000
3+++ plugins/fade/src/fade.cpp 2013-05-21 13:25:31 +0000
4@@ -252,10 +252,10 @@
5
6 newSaturation = saturation;
7 if (fAttrib.saturation > saturation)
8- saturation = MIN (saturation + (steps / 6),
9+ newSaturation = MIN (saturation + (steps / 6),
10 fAttrib.saturation);
11 else if (fAttrib.saturation < saturation)
12- saturation = MAX (saturation - (steps / 6),
13+ newSaturation = MAX (saturation - (steps / 6),
14 fAttrib.saturation);
15 }
16 else if (mode == FadeOptions::FadeModeConstantTime)

Subscribers

People subscribed via source and target branches