Merge lp:~3v1n0/compiz/scale-xy-offsets into lp:compiz/0.9.11

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 3824
Merged at revision: 3829
Proposed branch: lp:~3v1n0/compiz/scale-xy-offsets
Merge into: lp:compiz/0.9.11
Diff against target: 393 lines (+91/-74)
3 files modified
debian/patches/ubuntu-config.patch (+59/-58)
plugins/scale/scale.xml.in (+12/-0)
plugins/scale/src/scale.cpp (+20/-16)
To merge this branch: bzr merge lp:~3v1n0/compiz/scale-xy-offsets
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Azzarone Approve
Review via email: mp+206748@code.launchpad.net

Commit message

Scale: add {x,y_offset} options so we can move the scale despite the workarea

Description of the change

Add options to move the spread of a given x,y offset... This is needed in case we have an auto-hidden launcher in unity, so that we don't have a restricted workarea geometry and events over the panel would be grabbed.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~3v1n0/compiz/scale-xy-offsets updated
3823. By Marco Trevisan (Treviño)

UbuntuConfig: refresh the patch to match current scale.xml.in

3824. By Marco Trevisan (Treviño)

Scale: set minimum offset value to 0

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/patches/ubuntu-config.patch'
2--- debian/patches/ubuntu-config.patch 2013-12-04 19:21:12 +0000
3+++ debian/patches/ubuntu-config.patch 2014-02-17 20:36:48 +0000
4@@ -1,8 +1,8 @@
5 === modified file 'metadata/core.xml.in'
6-Index: compiz/metadata/core.xml.in
7+Index: scale-xy-offsets/metadata/core.xml.in
8 ===================================================================
9---- compiz.orig/metadata/core.xml.in 2013-10-08 17:00:56.932757923 +0200
10-+++ compiz/metadata/core.xml.in 2013-10-08 17:00:56.916757966 +0200
11+--- scale-xy-offsets.orig/metadata/core.xml.in 2014-02-17 21:25:57.420121366 +0100
12++++ scale-xy-offsets/metadata/core.xml.in 2014-02-17 21:25:57.408121419 +0100
13 @@ -139,7 +139,7 @@
14 <option name="focus_prevention_match" type="match">
15 <_short>Focus Prevention Windows</_short>
16@@ -65,10 +65,10 @@
17 <min>1</min>
18 <max>32</max>
19 </option>
20-Index: compiz/plugins/animation/animation.xml.in
21+Index: scale-xy-offsets/plugins/animation/animation.xml.in
22 ===================================================================
23---- compiz.orig/plugins/animation/animation.xml.in 2013-10-08 17:00:56.932757923 +0200
24-+++ compiz/plugins/animation/animation.xml.in 2013-10-08 17:00:56.920757955 +0200
25+--- scale-xy-offsets.orig/plugins/animation/animation.xml.in 2014-02-17 21:25:57.420121366 +0100
26++++ scale-xy-offsets/plugins/animation/animation.xml.in 2014-02-17 21:25:57.408121419 +0100
27 @@ -36,7 +36,7 @@
28 <extensible/>
29 <sort start="2"/>
30@@ -207,10 +207,10 @@
31 <min>0</min>
32 <max>1</max>
33 <precision>0.01</precision>
34-Index: compiz/plugins/decor/decor.xml.in
35+Index: scale-xy-offsets/plugins/decor/decor.xml.in
36 ===================================================================
37---- compiz.orig/plugins/decor/decor.xml.in 2013-10-08 17:00:56.932757923 +0200
38-+++ compiz/plugins/decor/decor.xml.in 2013-10-08 17:00:56.920757955 +0200
39+--- scale-xy-offsets.orig/plugins/decor/decor.xml.in 2014-02-17 21:25:57.420121366 +0100
40++++ scale-xy-offsets/plugins/decor/decor.xml.in 2014-02-17 21:25:57.412121402 +0100
41 @@ -31,7 +31,7 @@
42 <option name="active_shadow_opacity" type="float">
43 <_short>Shadow Opacity</_short>
44@@ -247,10 +247,10 @@
45 </option>
46 <option name="mipmap" type="bool">
47 <_short>Mipmap</_short>
48-Index: compiz/plugins/fade/fade.xml.in
49+Index: scale-xy-offsets/plugins/fade/fade.xml.in
50 ===================================================================
51---- compiz.orig/plugins/fade/fade.xml.in 2013-10-08 17:00:56.932757923 +0200
52-+++ compiz/plugins/fade/fade.xml.in 2013-10-08 17:00:56.920757955 +0200
53+--- scale-xy-offsets.orig/plugins/fade/fade.xml.in 2014-02-17 21:25:57.420121366 +0100
54++++ scale-xy-offsets/plugins/fade/fade.xml.in 2014-02-17 21:25:57.412121402 +0100
55 @@ -10,6 +10,7 @@
56 </requirement>
57 <relation type="after">
58@@ -268,10 +268,10 @@
59 </option>
60 <option name="visual_bell" type="bell">
61 <_short>Visual Bell</_short>
62-Index: compiz/plugins/gnomecompat/gnomecompat.xml.in
63+Index: scale-xy-offsets/plugins/gnomecompat/gnomecompat.xml.in
64 ===================================================================
65---- compiz.orig/plugins/gnomecompat/gnomecompat.xml.in 2013-10-08 17:00:56.932757923 +0200
66-+++ compiz/plugins/gnomecompat/gnomecompat.xml.in 2013-10-08 17:00:56.920757955 +0200
67+--- scale-xy-offsets.orig/plugins/gnomecompat/gnomecompat.xml.in 2014-02-17 21:25:57.420121366 +0100
68++++ scale-xy-offsets/plugins/gnomecompat/gnomecompat.xml.in 2014-02-17 21:25:57.412121402 +0100
69 @@ -53,6 +53,7 @@
70 <option name="run_command_terminal_key" type="key">
71 <_short>Open a terminal</_short>
72@@ -280,10 +280,10 @@
73 </option>
74 </group>
75 </options>
76-Index: compiz/plugins/place/place.xml.in
77+Index: scale-xy-offsets/plugins/place/place.xml.in
78 ===================================================================
79---- compiz.orig/plugins/place/place.xml.in 2013-10-08 17:00:56.932757923 +0200
80-+++ compiz/plugins/place/place.xml.in 2013-10-08 17:00:56.920757955 +0200
81+--- scale-xy-offsets.orig/plugins/place/place.xml.in 2014-02-17 21:25:57.420121366 +0100
82++++ scale-xy-offsets/plugins/place/place.xml.in 2014-02-17 21:25:57.412121402 +0100
83 @@ -20,8 +20,8 @@
84 <option name="mode" type="int">
85 <_short>Placement Mode</_short>
86@@ -295,10 +295,10 @@
87 <max>5</max>
88 <desc>
89 <value>0</value>
90-Index: compiz/plugins/resize/resize.xml.in
91+Index: scale-xy-offsets/plugins/resize/resize.xml.in
92 ===================================================================
93---- compiz.orig/plugins/resize/resize.xml.in 2013-10-08 17:00:56.932757923 +0200
94-+++ compiz/plugins/resize/resize.xml.in 2013-10-08 17:00:56.920757955 +0200
95+--- scale-xy-offsets.orig/plugins/resize/resize.xml.in 2014-02-17 21:25:57.420121366 +0100
96++++ scale-xy-offsets/plugins/resize/resize.xml.in 2014-02-17 21:25:57.412121402 +0100
97 @@ -28,7 +28,7 @@
98 <option name="mode" type="int">
99 <_short>Default Resize Mode</_short>
100@@ -343,11 +343,11 @@
101 </default>
102 </option>
103 <subgroup>
104-Index: compiz/plugins/scale/scale.xml.in
105+Index: scale-xy-offsets/plugins/scale/scale.xml.in
106 ===================================================================
107---- compiz.orig/plugins/scale/scale.xml.in 2013-10-08 17:00:56.932757923 +0200
108-+++ compiz/plugins/scale/scale.xml.in 2013-10-08 17:00:56.920757955 +0200
109-@@ -19,14 +19,14 @@
110+--- scale-xy-offsets.orig/plugins/scale/scale.xml.in 2014-02-17 21:25:57.420121366 +0100
111++++ scale-xy-offsets/plugins/scale/scale.xml.in 2014-02-17 21:31:47.058611881 +0100
112+@@ -19,7 +19,7 @@
113 <option name="spacing" type="int">
114 <_short>Spacing</_short>
115 <_long>Space between windows</_long>
116@@ -356,6 +356,7 @@
117 <min>0</min>
118 <max>250</max>
119 </option>
120+@@ -36,7 +36,7 @@
121 <option name="speed" type="float">
122 <_short>Speed</_short>
123 <_long>Scale speed</_long>
124@@ -364,7 +365,7 @@
125 <min>0.1</min>
126 <max>50</max>
127 <precision>0.1</precision>
128-@@ -34,7 +34,7 @@
129+@@ -44,7 +44,7 @@
130 <option name="timestep" type="float">
131 <_short>Timestep</_short>
132 <_long>Scale timestep</_long>
133@@ -373,7 +374,7 @@
134 <min>0.1</min>
135 <max>50</max>
136 <precision>0.1</precision>
137-@@ -47,7 +47,7 @@
138+@@ -57,7 +57,7 @@
139 <option name="opacity" type="int">
140 <_short>Opacity</_short>
141 <_long>Amount of opacity in percent</_long>
142@@ -382,7 +383,7 @@
143 <min>0</min>
144 <max>100</max>
145 </option>
146-@@ -56,7 +56,7 @@
147+@@ -66,7 +66,7 @@
148 <_long>Overlay an icon on windows once they are scaled</_long>
149 <min>0</min>
150 <max>2</max>
151@@ -391,7 +392,7 @@
152 <desc>
153 <value>0</value>
154 <_name>None</_name>
155-@@ -97,7 +97,7 @@
156+@@ -107,7 +107,7 @@
157 <_long>Selects where windows are scaled if multiple output devices are used.</_long>
158 <min>0</min>
159 <max>1</max>
160@@ -400,7 +401,7 @@
161 <desc>
162 <value>0</value>
163 <_name>On current output device</_name>
164-@@ -113,7 +113,7 @@
165+@@ -123,7 +123,7 @@
166 <option name="key_bindings_toggle" type="bool">
167 <_short>Key Bindings Toggle Scale Mode</_short>
168 <_long>Key bindings toggle scale mode instead of enabling it when pressed and disabling it when released.</_long>
169@@ -409,7 +410,7 @@
170 </option>
171 <option name="button_bindings_toggle" type="bool">
172 <_short>Button Bindings Toggle Scale Mode</_short>
173-@@ -123,15 +123,12 @@
174+@@ -133,15 +133,12 @@
175 <option name="initiate_edge" type="edge">
176 <_short>Initiate Window Picker</_short>
177 <_long>Layout and start transforming windows</_long>
178@@ -426,10 +427,10 @@
179 </option>
180 <option name="initiate_button" type="button">
181 <_short>Initiate Window Picker</_short>
182-Index: compiz/plugins/staticswitcher/staticswitcher.xml.in
183+Index: scale-xy-offsets/plugins/staticswitcher/staticswitcher.xml.in
184 ===================================================================
185---- compiz.orig/plugins/staticswitcher/staticswitcher.xml.in 2013-10-08 17:00:56.932757923 +0200
186-+++ compiz/plugins/staticswitcher/staticswitcher.xml.in 2013-10-08 17:00:56.920757955 +0200
187+--- scale-xy-offsets.orig/plugins/staticswitcher/staticswitcher.xml.in 2014-02-17 21:25:57.420121366 +0100
188++++ scale-xy-offsets/plugins/staticswitcher/staticswitcher.xml.in 2014-02-17 21:25:57.412121402 +0100
189 @@ -11,7 +11,6 @@
190 <relation type="after">
191 <plugin>composite</plugin>
192@@ -506,10 +507,10 @@
193 <desc>
194 <value>0</value>
195 <_name>None</_name>
196-Index: compiz/plugins/vpswitch/vpswitch.xml.in
197+Index: scale-xy-offsets/plugins/vpswitch/vpswitch.xml.in
198 ===================================================================
199---- compiz.orig/plugins/vpswitch/vpswitch.xml.in 2013-10-08 17:00:56.932757923 +0200
200-+++ compiz/plugins/vpswitch/vpswitch.xml.in 2013-10-08 17:00:56.924757944 +0200
201+--- scale-xy-offsets.orig/plugins/vpswitch/vpswitch.xml.in 2014-02-17 21:25:57.420121366 +0100
202++++ scale-xy-offsets/plugins/vpswitch/vpswitch.xml.in 2014-02-17 21:25:57.412121402 +0100
203 @@ -95,13 +95,11 @@
204 <option name="next_button" type="button">
205 <_short>Move Next</_short>
206@@ -524,10 +525,10 @@
207 <internal/>
208 </option>
209 <option name="initiate_button" type="button">
210-Index: compiz/plugins/wall/wall.xml.in
211+Index: scale-xy-offsets/plugins/wall/wall.xml.in
212 ===================================================================
213---- compiz.orig/plugins/wall/wall.xml.in 2013-10-08 17:00:56.932757923 +0200
214-+++ compiz/plugins/wall/wall.xml.in 2013-10-08 17:00:56.924757944 +0200
215+--- scale-xy-offsets.orig/plugins/wall/wall.xml.in 2014-02-17 21:25:57.420121366 +0100
216++++ scale-xy-offsets/plugins/wall/wall.xml.in 2014-02-17 21:25:57.416121383 +0100
217 @@ -30,12 +30,12 @@
218 <option name="miniscreen" type="bool">
219 <_short>Show Live Viewport Previews</_short>
220@@ -684,10 +685,10 @@
221 </option>
222 <option name="edgeflip_dnd" type="bool">
223 <_short>Edge Flip DnD</_short>
224-Index: compiz/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
225+Index: scale-xy-offsets/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp
226 ===================================================================
227---- compiz.orig/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2013-10-08 17:00:56.932757923 +0200
228-+++ compiz/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2013-10-08 17:00:56.924757944 +0200
229+--- scale-xy-offsets.orig/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2014-02-17 21:25:57.420121366 +0100
230++++ scale-xy-offsets/tests/system/xorg-gtest/tests/compiz_xorg_gtest_ewmh.cpp 2014-02-17 21:25:57.416121383 +0100
231 @@ -46,7 +46,7 @@
232
233 namespace
234@@ -697,10 +698,10 @@
235 unsigned int DEFAULT_VIEWPORT_HEIGHT = 1;
236
237 bool Advance (Display *d, bool r)
238-Index: compiz/plugins/grid/grid.xml.in
239+Index: scale-xy-offsets/plugins/grid/grid.xml.in
240 ===================================================================
241---- compiz.orig/plugins/grid/grid.xml.in 2013-12-04 12:23:44.021963832 -0500
242-+++ compiz/plugins/grid/grid.xml.in 2013-12-04 12:24:43.885963254 -0500
243+--- scale-xy-offsets.orig/plugins/grid/grid.xml.in 2014-02-17 21:25:57.420121366 +0100
244++++ scale-xy-offsets/plugins/grid/grid.xml.in 2014-02-17 21:25:57.416121383 +0100
245 @@ -68,12 +68,12 @@
246 <option name="put_maximize_key" type="key">
247 <_short>Maximize Key</_short>
248@@ -716,10 +717,10 @@
249 </option>
250 <option name="left_maximize" type="key">
251 <_short>Left Maximize</_short>
252-Index: compiz/plugins/ezoom/ezoom.xml.in
253+Index: scale-xy-offsets/plugins/ezoom/ezoom.xml.in
254 ===================================================================
255---- compiz.orig/plugins/ezoom/ezoom.xml.in 2013-10-08 17:00:56.932757923 +0200
256-+++ compiz/plugins/ezoom/ezoom.xml.in 2013-10-08 17:00:56.924757944 +0200
257+--- scale-xy-offsets.orig/plugins/ezoom/ezoom.xml.in 2014-02-17 21:25:57.420121366 +0100
258++++ scale-xy-offsets/plugins/ezoom/ezoom.xml.in 2014-02-17 21:25:57.416121383 +0100
259 @@ -30,7 +30,7 @@
260 <option type="button" name="zoom_in_button">
261 <_short>Zoom In Button</_short>
262@@ -756,10 +757,10 @@
263 </option>
264 </subgroup>
265 </group>
266-Index: compiz/plugins/expo/expo.xml.in
267+Index: scale-xy-offsets/plugins/expo/expo.xml.in
268 ===================================================================
269---- compiz.orig/plugins/expo/expo.xml.in 2013-10-08 17:00:56.932757923 +0200
270-+++ compiz/plugins/expo/expo.xml.in 2013-10-08 17:00:56.924757944 +0200
271+--- scale-xy-offsets.orig/plugins/expo/expo.xml.in 2014-02-17 21:25:57.420121366 +0100
272++++ scale-xy-offsets/plugins/expo/expo.xml.in 2014-02-17 21:25:57.416121383 +0100
273 @@ -17,6 +17,7 @@
274 <plugin>wobbly</plugin>
275 <plugin>animation</plugin>
276@@ -854,10 +855,10 @@
277 </option>
278 <option name="ground_color1" type="color">
279 <_short>Ground Color (near)</_short>
280-Index: compiz/compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml
281+Index: scale-xy-offsets/compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml
282 ===================================================================
283---- compiz.orig/compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2013-10-08 17:00:56.932757923 +0200
284-+++ compiz/compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2013-10-08 17:00:56.924757944 +0200
285+--- scale-xy-offsets.orig/compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2014-02-17 21:25:57.420121366 +0100
286++++ scale-xy-offsets/compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2014-02-17 21:25:57.416121383 +0100
287 @@ -10,6 +10,9 @@
288 <key type="s" name="command-screenshot">
289 <default>"gnome-screenshot"</default>
290@@ -878,10 +879,10 @@
291 <key type="s" name="command-12">
292 <default>""</default>
293 </key>
294-Index: compiz/plugins/commands/commands.xml.in
295+Index: scale-xy-offsets/plugins/commands/commands.xml.in
296 ===================================================================
297---- compiz.orig/plugins/commands/commands.xml.in 2013-10-08 17:00:56.932757923 +0200
298-+++ compiz/plugins/commands/commands.xml.in 2013-10-08 17:00:56.924757944 +0200
299+--- scale-xy-offsets.orig/plugins/commands/commands.xml.in 2014-02-17 21:25:57.420121366 +0100
300++++ scale-xy-offsets/plugins/commands/commands.xml.in 2014-02-17 21:25:57.416121383 +0100
301 @@ -117,7 +117,7 @@
302 <option name="command20" type="string">
303 <_short>Command line 20</_short>
304
305=== modified file 'plugins/scale/scale.xml.in'
306--- plugins/scale/scale.xml.in 2013-11-11 20:07:16 +0000
307+++ plugins/scale/scale.xml.in 2014-02-17 20:36:48 +0000
308@@ -23,6 +23,18 @@
309 <min>0</min>
310 <max>250</max>
311 </option>
312+ <option name="x_offset" type="int">
313+ <_short>X Offset</_short>
314+ <_long>Horizontal offset (in pixels).</_long>
315+ <min>0</min>
316+ <default>0</default>
317+ </option>
318+ <option name="y_offset" type="int">
319+ <_short>Y Offset</_short>
320+ <_long>Vertical offset (in pixels).</_long>
321+ <min>0</min>
322+ <default>0</default>
323+ </option>
324 <option name="speed" type="float">
325 <_short>Speed</_short>
326 <_long>Scale speed</_long>
327
328=== modified file 'plugins/scale/src/scale.cpp'
329--- plugins/scale/src/scale.cpp 2013-11-11 20:07:16 +0000
330+++ plugins/scale/src/scale.cpp 2014-02-17 20:36:48 +0000
331@@ -435,15 +435,15 @@
332 int spacing = optionGetSpacing ();
333 int nSlots = 0;
334
335- y = workArea.y () + spacing;
336- height = (workArea.height () - (lines + 1) * spacing) / lines;
337+ y = optionGetYOffset() + workArea.y () + spacing;
338+ height = (workArea.height () - optionGetYOffset() - (lines + 1) * spacing) / lines;
339
340 for (int i = 0; i < lines; i++)
341 {
342 n = MIN (nWindows - nSlots, ceilf ((float) nWindows / lines));
343
344- x = workArea.x () + spacing;
345- width = (workArea.width () - (n + 1) * spacing) / n;
346+ x = optionGetXOffset() + workArea.x () + spacing;
347+ width = (workArea.width () - optionGetXOffset() - (n + 1) * spacing) / n;
348
349 for (int j = 0; j < n; j++)
350 {
351@@ -1614,6 +1614,8 @@
352 {
353 CompPoint pointer (button->x_root, button->y_root);
354 CompRect workArea (screen->workArea ());
355+ workArea.setX (workArea.x() + optionGetXOffset ());
356+ workArea.setY (workArea.y() + optionGetYOffset ());
357
358 if (workArea.contains (pointer))
359 {
360@@ -1622,19 +1624,21 @@
361 screen->enterShowDesktopMode ();
362 }
363 }
364- else if (optionGetClickOnDesktop () == 2 &&
365- event->xbutton.button == Button1)
366- {
367- CompPoint pointer (button->x_root, button->y_root);
368- CompRect workArea (screen->workArea ());
369+ else if (optionGetClickOnDesktop () == 2 &&
370+ event->xbutton.button == Button1)
371+ {
372+ CompPoint pointer (button->x_root, button->y_root);
373+ CompRect workArea (screen->workArea ());
374+ workArea.setX (workArea.x() + optionGetXOffset ());
375+ workArea.setY (workArea.y() + optionGetYOffset ());
376
377- if (workArea.contains (pointer))
378- {
379- scaleTerminate (&optionGetInitiateEdge (), 0, o);
380- scaleTerminate (&optionGetInitiateKey (), 0, o);
381- }
382- }
383- }
384+ if (workArea.contains (pointer))
385+ {
386+ scaleTerminate (&optionGetInitiateEdge (), 0, o);
387+ scaleTerminate (&optionGetInitiateKey (), 0, o);
388+ }
389+ }
390+ }
391 break;
392 case MotionNotify:
393 if (screen->root () == event->xmotion.root &&

Subscribers

People subscribed via source and target branches