Merge lp:~marcobiscaro2112/unity/custom-bg into lp:unity

Proposed by Marco Biscaro
Status: Superseded
Proposed branch: lp:~marcobiscaro2112/unity/custom-bg
Merge into: lp:unity
Diff against target: 32 lines (+10/-1)
2 files modified
launcher/Launcher.cpp (+4/-1)
unity-shared/BGHash.cpp (+6/-0)
To merge this branch: bzr merge lp:~marcobiscaro2112/unity/custom-bg
Reviewer Review Type Date Requested Status
Omer Akram (community) Needs Fixing
Thomi Richards Pending
Review via email: mp+112933@code.launchpad.net

This proposal supersedes a proposal from 2012-05-10.

This proposal has been superseded by a proposal from 2012-07-12.

Description of the change

Fixing bug #924586 and bug #975350, both about custom background color.

I moved the check of an override color from OnBackgroundChanged to RefreshColor (which is called when a PropertyNotify event happens). Also added a check in FullySaturateColor to avoid division by zero.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Doug McMahon (mc3man) wrote : Posted in a previous version of this proposal

If this needs another reviewer to check & possibly approve then how about someone do so. Myself have seen no ill effects when applied to either the 5.12 -0ubuntu1.1 & 5.12 -0ubuntu2 sources & it fixes both targeted bugs

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

I wonder if this fixes bug 1010335 too?...

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

I've now tested this proposal and bug 1010335 is not fixed by it.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Manual testing reveals:
Bug 924586 is fixed.
Bug 975350 is not fixed (all custom colouring is still lost when the dash opens).

review: Needs Fixing
Revision history for this message
Doug McMahon (mc3man) wrote : Posted in a previous version of this proposal

Well obviously the above diff worked just fine in 5.12/12.04 to fix both bugs. Also, at least here with a minor change to the BGHash.cpp section using todays unity trunk thru r 2404, a custom color is maintained thru opening Dash, log outs/in's, ect. (#000000 is still good also
hopefully whatever you all do is provided to both 12.04 with whatever unity is going to be used & 12.10

Revision history for this message
Gord Allott (gordallott) wrote :

9 + if (max != 0)

lets change that to
if (max > 0.0)

comparing floats to ints is full of danger.

Revision history for this message
Omer Akram (om26er) :
review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/Launcher.cpp'
2--- launcher/Launcher.cpp 2012-07-11 05:46:00 +0000
3+++ launcher/Launcher.cpp 2012-07-12 14:06:21 +0000
4@@ -964,7 +964,10 @@
5 nux::Color FullySaturateColor (nux::Color color)
6 {
7 float max = std::max<float>(color.red, std::max<float>(color.green, color.blue));
8- color = color * (1.0f / max);
9+ if (max > 0.0f)
10+ {
11+ color = color * (1.0f / max);
12+ }
13 return color;
14 }
15
16
17=== modified file 'unity-shared/BGHash.cpp'
18--- unity-shared/BGHash.cpp 2012-06-18 02:57:23 +0000
19+++ unity-shared/BGHash.cpp 2012-07-12 14:06:21 +0000
20@@ -59,6 +59,12 @@
21
22 void BGHash::RefreshColor()
23 {
24+ if (override_color_.alpha)
25+ {
26+ TransitionToNewColor (override_color_);
27+ return;
28+ }
29+
30 Atom real_type;
31 gint result;
32 gint real_format;