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
=== modified file 'launcher/Launcher.cpp'
--- launcher/Launcher.cpp 2012-09-01 16:01:02 +0000
+++ launcher/Launcher.cpp 2012-09-03 00:09:22 +0000
@@ -953,7 +953,10 @@
953nux::Color FullySaturateColor (nux::Color color)953nux::Color FullySaturateColor (nux::Color color)
954{954{
955 float max = std::max<float>(color.red, std::max<float>(color.green, color.blue));955 float max = std::max<float>(color.red, std::max<float>(color.green, color.blue));
956 color = color * (1.0f / max);956 if (max > 0.0f)
957 {
958 color = color * (1.0f / max);
959 }
957 return color;960 return color;
958}961}
959962
960963
=== modified file 'manual-tests/Launcher.txt'
--- manual-tests/Launcher.txt 2012-08-30 22:24:40 +0000
+++ manual-tests/Launcher.txt 2012-09-03 00:09:22 +0000
@@ -731,3 +731,21 @@
731731
732Expected Results:732Expected Results:
733* The gedit window must not flicker behind the launcher.733* The gedit window must not flicker behind the launcher.
734
735
736Custom background color works
737-----------------------------
738This test ensures that the custom background color (set via ccsm) works correctly.
739
740Setup:
741#. Ensure that ccsm is installed (package compizconfig-settings-manager)
742
743Actions:
744#. Open ccsm
745#. Click on Ubuntu Unity Plugin
746#. Choose Experimental tab, click on Background Color, set Color name to #000000 and Opacity to 180
747
748Expected Result:
749 The background color of the Launcher is black, and the icons are still visible.
750 The Launcher must stay black when Dash or HUD are opened, and the color must
751 be persistent between sessions (logout/login).
734752
=== modified file 'unity-shared/BGHash.cpp'
--- unity-shared/BGHash.cpp 2012-08-15 05:29:29 +0000
+++ unity-shared/BGHash.cpp 2012-09-03 00:09:22 +0000
@@ -46,17 +46,17 @@
46{46{
47 override_color_ = color;47 override_color_ = color;
4848
49 if (override_color_.alpha)49 RefreshColor();
50}
51
52void BGHash::RefreshColor()
53{
54 if (override_color_.alpha > 0.0f)
50 {55 {
51 TransitionToNewColor(override_color_);56 TransitionToNewColor(override_color_);
52 return;57 return;
53 }58 }
5459
55 RefreshColor();
56}
57
58void BGHash::RefreshColor()
59{
60 Atom real_type;60 Atom real_type;
61 gint result;61 gint result;
62 gint real_format;62 gint real_format;