Merge lp:~mc-return/compiz/compiz.merge-fix1070233-resize-info-gradient-color-settings-ignored into lp:compiz/0.9.9

Proposed by MC Return
Status: Merged
Approved by: Martin Mrazik
Approved revision: 3451
Merged at revision: 3453
Proposed branch: lp:~mc-return/compiz/compiz.merge-fix1070233-resize-info-gradient-color-settings-ignored
Merge into: lp:compiz/0.9.9
Diff against target: 82 lines (+15/-15)
2 files modified
plugins/resizeinfo/resizeinfo.xml.in (+7/-7)
plugins/resizeinfo/src/resizeinfo.cpp (+8/-8)
To merge this branch: bzr merge lp:~mc-return/compiz/compiz.merge-fix1070233-resize-info-gradient-color-settings-ignored
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Daniel van Vugt Approve
MC Return Needs Resubmitting
Sam Spilsbury Approve
Review via email: mp+132489@code.launchpad.net

Commit message

Resizeinfo Plug-in:
Fixed options to change Gradient Color 2 and Gradient Color 3 having no effect and enabled possibility for a gradient background.
(LP: #1070233)

Description of the change

As requested by Daniel, I am separating the fixes for the resizeinfo problems.
This branch just fixes CCSM resizeinfo plug-in's gradient color settings being ignored.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Oh, blah, the original author seems to have use GradientN for everything, which makes the code annoying to review:

8 - r = is->optionGetGradient1Red () / (float)0xffff;
9 - g = is->optionGetGradient1Green () / (float)0xffff;
10 - b = is->optionGetGradient1Blue () / (float)0xffff;
11 - a = is->optionGetGradient1Alpha () / (float)0xffff;
12 + r = is->optionGetGradient2Red () / (float)0xffff;
13 + g = is->optionGetGradient2Green () / (float)0xffff;
14 + b = is->optionGetGradient2Blue () / (float)0xffff;
15 + a = is->optionGetGradient2Alpha () / (float)0xffff;

My advice earlier about using static_cast and numeric_limits still applies here.

Do you think you could also change the gradient_n names in the xml file to something more sensible while you're at it too?

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

> Oh, blah, the original author seems to have use GradientN for everything,
> which makes the code annoying to review:
>
> 8 - r = is->optionGetGradient1Red () / (float)0xffff;
> 9 - g = is->optionGetGradient1Green () / (float)0xffff;
> 10 - b = is->optionGetGradient1Blue () / (float)0xffff;
> 11 - a = is->optionGetGradient1Alpha () / (float)0xffff;
> 12 + r = is->optionGetGradient2Red () / (float)0xffff;
> 13 + g = is->optionGetGradient2Green () / (float)0xffff;
> 14 + b = is->optionGetGradient2Blue () / (float)0xffff;
> 15 + a = is->optionGetGradient2Alpha () / (float)0xffff;
>
> My advice earlier about using static_cast and numeric_limits still applies
> here.
>

Done.

> Do you think you could also change the gradient_n names in the xml file to
> something more sensible while you're at it too?

Sure, but I would like to do that in a separate branch once this branch and https://code.launchpad.net/~mc-return/compiz/compiz.merge-fix1070297-no-possibility-to-change-background-outline-color/+merge/132500 are merged, because otherwise there will be conflicts as I've renamed 'static void gradientChanged' to 'static void backgroundColorChanged' there.

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

> Do you think you could also change the gradient_n names in the xml file to
> something more sensible while you're at it too?

I've improved the tooltips in r3449 for now to make it more clear what Gradient Color 1-3 mean.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> > Oh, blah, the original author seems to have use GradientN for everything,
> > which makes the code annoying to review:
> >
> > 8 - r = is->optionGetGradient1Red () / (float)0xffff;
> > 9 - g = is->optionGetGradient1Green () / (float)0xffff;
> > 10 - b = is->optionGetGradient1Blue () / (float)0xffff;
> > 11 - a = is->optionGetGradient1Alpha () / (float)0xffff;
> > 12 + r = is->optionGetGradient2Red () / (float)0xffff;
> > 13 + g = is->optionGetGradient2Green () / (float)0xffff;
> > 14 + b = is->optionGetGradient2Blue () / (float)0xffff;
> > 15 + a = is->optionGetGradient2Alpha () / (float)0xffff;
> >
> > My advice earlier about using static_cast and numeric_limits still applies
> > here.
> >
>
> Done.
>
> > Do you think you could also change the gradient_n names in the xml file to
> > something more sensible while you're at it too?
>
> Sure, but I would like to do that in a separate branch once this branch and
> https://code.launchpad.net/~mc-return/compiz/compiz.merge-fix1070297-no-
> possibility-to-change-background-outline-color/+merge/132500 are merged,
> because otherwise there will be conflicts as I've renamed 'static void
> gradientChanged' to 'static void backgroundColorChanged' there.

Yeah that's fine.

+1 on the other changes, see the advice on the other MP about the constant too in case you're interested :)

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

Sam, thanks again for review and approval.
As commented in the other branch already I would prefer to do this final polishing together with the gradient_1-3 name changes once the resizeinfo branches are merged to prevent conflicts and double-work.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm not sure how it works, if at all, but it probably shouldn't...

static_cast <float> (std::numeric_limits <int>::max ())

that will have a value of 0x7fffffff (32-bit x86) or 0x7fffffffffffffff (64-bit), both of which are wrong. Colours should be relative to 0xffff only, or "65535.0f".

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

> I'm not sure how it works, if at all, but it probably shouldn't...

It was working here...

> static_cast <float> (std::numeric_limits <int>::max ())
>
> that will have a value of 0x7fffffff (32-bit x86) or 0x7fffffffffffffff
> (64-bit), both of which are wrong. Colours should be relative to 0xffff only,
> or "65535.0f".

Going back to (float)0xffff.
As I've stated in the related resizeinfo branch already - if we want to change that style, it would be best to do it in a separate commit and for the whole lp:compiz code and all similar cases.

review: Needs Resubmitting
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, looks good now and works.

I would have recommended not updating the strings in the same branch, but it's not worth complaining about.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
MC Return (mc-return) wrote :

Seems like some Jenkins failure, from the console log:

bzr: ERROR: Error parsing trunk.recipe:4:25: End of line while looking for the subpath to merge.
Usage: nest-part NAME BRANCH SUBDIR [TARGET-DIR [REVISION]]
ERROR:pbuilderjenkins:Error during build execution
ERROR:pbuilderjenkins:Error while preparing from recipe:
pbuilder returned ERROR.
Build step 'Debian PBuilder NG' marked build as failure

Revision history for this message
Martin Mrazik (mrazik) wrote :

Correct. Re-approving.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Martin Mrazik (mrazik) wrote :

Re-approving again (fixed some more jenkins issues).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/resizeinfo/resizeinfo.xml.in'
2--- plugins/resizeinfo/resizeinfo.xml.in 2012-10-15 10:31:51 +0000
3+++ plugins/resizeinfo/resizeinfo.xml.in 2012-11-05 10:17:24 +0000
4@@ -18,19 +18,19 @@
5 <options>
6 <option name="fade_time" type="int">
7 <_short>Fade Time</_short>
8- <_long>Fade time (in ms) for popup window</_long>
9+ <_long>Fade time (in ms) for the popup window.</_long>
10 <default>500</default>
11 <min>10</min>
12 <max>5000</max>
13 </option>
14 <option name="always_show" type="bool">
15 <_short>Show resize info for all windows</_short>
16- <_long>Show resize info for all windows as opposed to just windows with a resize increment of greater than 1.</_long>
17+ <_long>Show resize info for all windows as opposed to just for windows with a resize increment of greater than 1.</_long>
18 <default>false</default>
19 </option>
20 <option name="text_color" type="color">
21- <_short>Text color</_short>
22- <_long>Color of text on resize popup.</_long>
23+ <_short>Text Color</_short>
24+ <_long>Color of the resize popup's text.</_long>
25 <default>
26 <red>0x0000</red>
27 <blue>0x0000</blue>
28@@ -40,7 +40,7 @@
29 </option>
30 <option name="gradient_1" type="color">
31 <_short>Gradient Color 1</_short>
32- <_long>Color 1 of the gradient background.</_long>
33+ <_long>Color on the left side of the gradient background.</_long>
34 <default>
35 <red>0xcccc</red>
36 <green>0xcccc</green>
37@@ -50,7 +50,7 @@
38 </option>
39 <option name="gradient_2" type="color">
40 <_short>Gradient Color 2</_short>
41- <_long>Color 2 of the gradient background.</_long>
42+ <_long>Color in the center of the gradient background.</_long>
43 <default>
44 <red>0xf332</red>
45 <green>0xf332</green>
46@@ -60,7 +60,7 @@
47 </option>
48 <option name="gradient_3" type="color">
49 <_short>Gradient Color 3</_short>
50- <_long>Color 3 of the gradient background.</_long>
51+ <_long>Color on the right side of the gradient background.</_long>
52 <default>
53 <red>0xd998</red>
54 <green>0xd998</green>
55
56=== modified file 'plugins/resizeinfo/src/resizeinfo.cpp'
57--- plugins/resizeinfo/src/resizeinfo.cpp 2012-09-07 23:29:42 +0000
58+++ plugins/resizeinfo/src/resizeinfo.cpp 2012-11-05 10:17:24 +0000
59@@ -205,16 +205,16 @@
60 a = is->optionGetGradient1Alpha () / (float)0xffff;
61 cairo_pattern_add_color_stop_rgba (pattern, 0.00f, r, g, b, a);
62
63- r = is->optionGetGradient1Red () / (float)0xffff;
64- g = is->optionGetGradient1Green () / (float)0xffff;
65- b = is->optionGetGradient1Blue () / (float)0xffff;
66- a = is->optionGetGradient1Alpha () / (float)0xffff;
67+ r = is->optionGetGradient2Red () / (float)0xffff;
68+ g = is->optionGetGradient2Green () / (float)0xffff;
69+ b = is->optionGetGradient2Blue () / (float)0xffff;
70+ a = is->optionGetGradient2Alpha () / (float)0xffff;
71 cairo_pattern_add_color_stop_rgba (pattern, 0.65f, r, g, b, a);
72
73- r = is->optionGetGradient1Red () / (float)0xffff;
74- g = is->optionGetGradient1Green () / (float)0xffff;
75- b = is->optionGetGradient1Blue () / (float)0xffff;
76- a = is->optionGetGradient1Alpha () / (float)0xffff;
77+ r = is->optionGetGradient3Red () / (float)0xffff;
78+ g = is->optionGetGradient3Green () / (float)0xffff;
79+ b = is->optionGetGradient3Blue () / (float)0xffff;
80+ a = is->optionGetGradient3Alpha () / (float)0xffff;
81 cairo_pattern_add_color_stop_rgba (pattern, 0.85f, r, g, b, a);
82 cairo_set_source (cr, pattern);
83

Subscribers

People subscribed via source and target branches