Merge lp:~feng-kylin/compiz/fix_gap_on_bottom into lp:compiz/0.9.12

Proposed by handsome_feng
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 4013
Merged at revision: 4022
Proposed branch: lp:~feng-kylin/compiz/fix_gap_on_bottom
Merge into: lp:compiz/0.9.12
Diff against target: 91 lines (+19/-4)
5 files modified
plugins/expo/expo.xml.in (+6/-0)
plugins/expo/src/expo.cpp (+3/-1)
plugins/scale/include/scale/scale.h (+1/-1)
plugins/scale/scale.xml.in (+7/-1)
plugins/scale/src/scale.cpp (+2/-1)
To merge this branch: bzr merge lp:~feng-kylin/compiz/fix_gap_on_bottom
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+294589@code.launchpad.net

Commit message

Add a YBottomOffset value when stretch maximized windows。

Description of the change

Add YBottomOffset so that you don't have an awkward gap。

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

Theoretically there's nothing wrong here. I question whether it would be better to have these as internal options configured by the unityshell plugin itself as opposed to user-facing ones.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> Theoretically there's nothing wrong here. I question whether it would be
> better to have these as internal options configured by the unityshell plugin
> itself as opposed to user-facing ones.

Yeah, i quite agree... You could just keep the options private. Although it's not an huge problem.

Once you've fixed things as per inline comments, we're good to go.

4013. By handsome_feng

fix indentation and workArea.setBottom

Revision history for this message
handsome_feng (feng-kylin) wrote :

Sam, Marco, Thanks for your suggestions. I have update the branch according to
the comments, but how to keep the options private ?

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/expo/expo.xml.in'
2--- plugins/expo/expo.xml.in 2015-10-26 17:15:43 +0000
3+++ plugins/expo/expo.xml.in 2016-05-16 06:27:27 +0000
4@@ -149,6 +149,12 @@
5 <_long>Vertical offset (in pixels).</_long>
6 <default>24</default>
7 </option>
8+ <option name="y_bottom_offset" type="int">
9+ <_short>Y Bottom Offset</_short>
10+ <_long>Vertical offset from the bottom (in pixels).</_long>
11+ <default>0</default>
12+ <min>0</min>
13+ </option>
14 <option name="distance" type="float">
15 <_short>Camera Distance</_short>
16 <_long>The distance between the camera and the exposed viewports.</_long>
17
18=== modified file 'plugins/expo/src/expo.cpp'
19--- plugins/expo/src/expo.cpp 2015-10-20 15:12:34 +0000
20+++ plugins/expo/src/expo.cpp 2016-05-16 06:27:27 +0000
21@@ -921,6 +921,8 @@
22 /* translate expo to center */
23 sTransform.translate (vpSize.x () * sx * -0.5 + offsetInWorldCoordX,
24 vpSize.y () * sy * 0.5 - offsetInWorldCoordY, 0.0f);
25+
26+ worldScaleFactorY -= (float)optionGetYBottomOffset () / (float)output->height ();
27 sTransform.scale (worldScaleFactorX, worldScaleFactorY, 1.0f);
28
29
30@@ -1503,7 +1505,7 @@
31 float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
32 float xS = 1.0 + ((o->width () / (float) window->width ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
33 wTransform.translate (window->x () + window->width (),
34- window->y () + window->height (),
35+ window->y () + window->height () + eScreen->optionGetYBottomOffset (),
36 0.0f);
37 wTransform.scale (xS, yS, 1.0f);
38 wTransform.translate (-(window->x () + window->width ()),
39
40=== modified file 'plugins/scale/include/scale/scale.h'
41--- plugins/scale/include/scale/scale.h 2014-04-15 16:47:09 +0000
42+++ plugins/scale/include/scale/scale.h 2016-05-16 06:27:27 +0000
43@@ -137,7 +137,7 @@
44 public:
45 ScaleWindow (CompWindow *w);
46 ~ScaleWindow ();
47-
48+
49 CompWindow *window;
50
51 bool hasSlot () const;
52
53=== modified file 'plugins/scale/scale.xml.in'
54--- plugins/scale/scale.xml.in 2015-10-26 17:15:43 +0000
55+++ plugins/scale/scale.xml.in 2016-05-16 06:27:27 +0000
56@@ -33,7 +33,13 @@
57 </option>
58 <option name="y_offset" type="int">
59 <_short>Y Offset</_short>
60- <_long>Vertical offset (in pixels).</_long>
61+ <_long>Vertical offset from the top (in pixels).</_long>
62+ <min>0</min>
63+ <default>0</default>
64+ </option>
65+ <option name="y_bottom_offset" type="int">
66+ <_short>Y Bottom Offset</_short>
67+ <_long>Vertical offset from the bottom (in pixels).</_long>)
68 <min>0</min>
69 <default>0</default>
70 </option>
71
72=== modified file 'plugins/scale/src/scale.cpp'
73--- plugins/scale/src/scale.cpp 2015-11-16 12:14:14 +0000
74+++ plugins/scale/src/scale.cpp 2016-05-16 06:27:27 +0000
75@@ -509,7 +509,7 @@
76 int nSlots = 0;
77
78 y = optionGetYOffset() + workArea.y () + spacing;
79- height = (workArea.height () - optionGetYOffset() - (lines + 1) * spacing) / lines;
80+ height = (workArea.height () - optionGetYOffset () - optionGetYBottomOffset () - (lines + 1) * spacing) / lines;
81
82 for (int i = 0; i < lines; i++)
83 {
84@@ -1752,6 +1752,7 @@
85 CompRect workArea (screen->currentOutputDev ().workArea ());
86 workArea.setX (workArea.x() + optionGetXOffset ());
87 workArea.setY (workArea.y() + optionGetYOffset ());
88+ workArea.setBottom (workArea.bottom () + optionGetYBottomOffset ());
89
90 if (workArea.contains (pointer))
91 {

Subscribers

People subscribed via source and target branches