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

Proposed by Marco Biscaro
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 2653
Proposed branch: lp:~marcobiscaro2112/unity/custom-bg
Merge into: lp:unity
Diff against target: 69 lines (+28/-7)
3 files modified
launcher/Launcher.cpp (+4/-1)
manual-tests/Launcher.txt (+18/-0)
unity-shared/BGHash.cpp (+6/-6)
To merge this branch: bzr merge lp:~marcobiscaro2112/unity/custom-bg
Reviewer Review Type Date Requested Status
MC Return (community) Approve
Andrea Azzarone (community) Approve
Nick Dedekind (community) Approve
Daniel van Vugt Pending
Omer Akram Pending
Thomi Richards Pending
Review via email: mp+114647@code.launchpad.net

This proposal supersedes a proposal from 2012-07-01.

Commit message

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

Now there is a check of an override color in RefreshColor (which is called when a PropertyNotify event happens). Also added a check in FullySaturateColor to avoid division by zero.

Description of the change

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

Now there is a check of an override color in 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 : Posted in a previous version of this proposal

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) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

I think it's ok now.

Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

Is there anyone out there?

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Looks good.

review: Approve
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Add at least a manual test please :)

review: Needs Fixing
Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

Manual test added.

Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

No commit message specified.

Revision history for this message
MC Return (mc-return) wrote :

A few improvements for the manual test:

+#. On Expiremental tab, change Background Color to #000000, 180 opacity
should be:
+#. Choose Experimental tab, click on Background Color, set Color name to #000000 and Opacity to 180.

+ The background color of Launcher is black, and the icons still visible.
should be:
+ The background color of the Launcher is black, and the icons are still visible.

+ The Launcher must still black when Dash or HUD is opened, and the color must
should be:
+ The Launcher must stay black when Dash or HUD are opened, and the color must

Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

Manual tests improved and duplicated code removed. Is it ok now?

Revision history for this message
MC Return (mc-return) wrote :

Expiremental tab -> Experimental tab

Revision history for this message
Marco Biscaro (marcobiscaro2112) wrote :

This MP fixes bug #1010335 too.

Revision history for this message
MC Return (mc-return) wrote :

LGTM.

review: Approve

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-09-01 16:01:02 +0000
3+++ launcher/Launcher.cpp 2012-09-03 00:09:22 +0000
4@@ -953,7 +953,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 'manual-tests/Launcher.txt'
18--- manual-tests/Launcher.txt 2012-08-30 22:24:40 +0000
19+++ manual-tests/Launcher.txt 2012-09-03 00:09:22 +0000
20@@ -731,3 +731,21 @@
21
22 Expected Results:
23 * The gedit window must not flicker behind the launcher.
24+
25+
26+Custom background color works
27+-----------------------------
28+This test ensures that the custom background color (set via ccsm) works correctly.
29+
30+Setup:
31+#. Ensure that ccsm is installed (package compizconfig-settings-manager)
32+
33+Actions:
34+#. Open ccsm
35+#. Click on Ubuntu Unity Plugin
36+#. Choose Experimental tab, click on Background Color, set Color name to #000000 and Opacity to 180
37+
38+Expected Result:
39+ The background color of the Launcher is black, and the icons are still visible.
40+ The Launcher must stay black when Dash or HUD are opened, and the color must
41+ be persistent between sessions (logout/login).
42
43=== modified file 'unity-shared/BGHash.cpp'
44--- unity-shared/BGHash.cpp 2012-08-15 05:29:29 +0000
45+++ unity-shared/BGHash.cpp 2012-09-03 00:09:22 +0000
46@@ -46,17 +46,17 @@
47 {
48 override_color_ = color;
49
50- if (override_color_.alpha)
51+ RefreshColor();
52+}
53+
54+void BGHash::RefreshColor()
55+{
56+ if (override_color_.alpha > 0.0f)
57 {
58 TransitionToNewColor(override_color_);
59 return;
60 }
61
62- RefreshColor();
63-}
64-
65-void BGHash::RefreshColor()
66-{
67 Atom real_type;
68 gint result;
69 gint real_format;