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
=== modified file 'launcher/Launcher.cpp'
--- launcher/Launcher.cpp 2012-07-11 05:46:00 +0000
+++ launcher/Launcher.cpp 2012-07-12 14:06:21 +0000
@@ -964,7 +964,10 @@
964nux::Color FullySaturateColor (nux::Color color)964nux::Color FullySaturateColor (nux::Color color)
965{965{
966 float max = std::max<float>(color.red, std::max<float>(color.green, color.blue));966 float max = std::max<float>(color.red, std::max<float>(color.green, color.blue));
967 color = color * (1.0f / max);967 if (max > 0.0f)
968 {
969 color = color * (1.0f / max);
970 }
968 return color;971 return color;
969}972}
970973
971974
=== modified file 'unity-shared/BGHash.cpp'
--- unity-shared/BGHash.cpp 2012-06-18 02:57:23 +0000
+++ unity-shared/BGHash.cpp 2012-07-12 14:06:21 +0000
@@ -59,6 +59,12 @@
5959
60void BGHash::RefreshColor()60void BGHash::RefreshColor()
61{61{
62 if (override_color_.alpha)
63 {
64 TransitionToNewColor (override_color_);
65 return;
66 }
67
62 Atom real_type;68 Atom real_type;
63 gint result;69 gint result;
64 gint real_format;70 gint real_format;