Merge lp:~samuel-thibault/compiz/ezoom-minmax into lp:compiz/0.9.13

Proposed by Samuel thibault
Status: Needs review
Proposed branch: lp:~samuel-thibault/compiz/ezoom-minmax
Merge into: lp:compiz/0.9.13
Diff against target: 359 lines (+80/-80)
2 files modified
plugins/ezoom/ezoom.xml.in (+61/-61)
plugins/ezoom/src/ezoom.cpp (+19/-19)
To merge this branch: bzr merge lp:~samuel-thibault/compiz/ezoom-minmax
Reviewer Review Type Date Requested Status
Alberts Muktupāvels Needs Information
Compiz Maintainers Pending
Review via email: mp+343183@code.launchpad.net

Commit message

Inverse minimum_zoom and autoscale_min into maximum_zoom and autoscale_max

The options themselves were saying: "A value of 0.5 equals 2x zoom", i.e. the value is counterintuitive, and it is much more user-friendly to inverse the values presented to the user.

To post a comment you must log in.
4145. By Samuel thibault

Inverse meaning of specific zoom level values

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Will not this break existing settings?

review: Needs Information
Revision history for this message
Samuel thibault (samuel-thibault) wrote :

Well, yes. I don't know how compiz usually copes with such kind of configuration change?

Revision history for this message
Alberts Muktupāvels (muktupavels) :
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Unfortunately I don't know either... Probably xml is used to limit min/max values in GUI, but that is only my guess.

There probably should be some migration script or maybe code could detect that value is in old range and automatically update to new? No idea about renamed setting...

Revision history for this message
Samuel thibault (samuel-thibault) wrote :

Here detection would be easy indeed: factors used to be always <= 1, and after this change they'd be always >= 1

Revision history for this message
Alex ARNAUD (alexarnaud) wrote :
Revision history for this message
Samuel thibault (samuel-thibault) :
Revision history for this message
Alex ARNAUD (alexarnaud) wrote :

@Alberts Muktupāvels: We won't work on migration script. So except if you want to work on it or merge it like it is you could close this as WONTFIX.

In the past gsettings have changed and broke configuration without any migration script:
My bug report about that: https://bugs.launchpad.net/compiz/+bug/1712570
The change that has created migration issue: https://bugs.launchpad.net/compiz/+bug/1201061

Best regards,
Alex.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

I am not the one who decides that... I don't even use compiz!

Unmerged revisions

4145. By Samuel thibault

Inverse meaning of specific zoom level values

4144. By ksamak

Inverse minimum_zoom and autoscale_min into maximum_zoom and autoscale_max

The options themselves were saying: "A value of 0.5 equals 2x zoom", i.e. the
value is counterintuitive, and it is much more user-friendly to inverse the
values presented to the user.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/ezoom/ezoom.xml.in'
2--- plugins/ezoom/ezoom.xml.in 2017-12-05 14:45:06 +0000
3+++ plugins/ezoom/ezoom.xml.in 2018-04-13 12:07:16 +0000
4@@ -105,9 +105,9 @@
5 <_short>Specific Zoom 1</_short>
6 <_long>Zoom level to go to when triggering hotkey 1</_long>
7 <default>1.0</default>
8- <min>0.1</min>
9- <max>1.0</max>
10- <precision>0.01</precision>
11+ <min>1.0</min>
12+ <max>10.0</max>
13+ <precision>0.1</precision>
14 </option>
15 <option type="key" name="zoom_specific_1_key">
16 <_short>Zoom to Specific Zoom 1</_short>
17@@ -118,9 +118,9 @@
18 <_short>Specific Zoom 2</_short>
19 <_long>Zoom level to go to when triggering hotkey 2</_long>
20 <default>1.0</default>
21- <min>0.1</min>
22- <max>1.0</max>
23- <precision>0.01</precision>
24+ <min>1.0</min>
25+ <max>10.0</max>
26+ <precision>0.1</precision>
27 </option>
28 <option type="key" name="zoom_specific_2_key">
29 <_short>Zoom to Specific Zoom 2</_short>
30@@ -131,9 +131,9 @@
31 <_short>Specific Zoom 3</_short>
32 <_long>Zoom level to go to when triggering hotkey 3</_long>
33 <default>1.0</default>
34- <min>0.1</min>
35- <max>1.0</max>
36- <precision>0.01</precision>
37+ <min>1.0</min>
38+ <max>10.0</max>
39+ <precision>0.1</precision>
40 </option>
41 <option type="key" name="zoom_specific_3_key">
42 <_short>Zoom to Specific Zoom 3</_short>
43@@ -144,9 +144,9 @@
44 <_short>Specific Zoom 4</_short>
45 <_long>Zoom level to go to when triggering hotkey 4</_long>
46 <default>1.0</default>
47- <min>0.1</min>
48- <max>1.0</max>
49- <precision>0.01</precision>
50+ <min>1.0</min>
51+ <max>10.0</max>
52+ <precision>0.1</precision>
53 </option>
54 <option type="key" name="zoom_specific_4_key">
55 <_short>Zoom to Specific Zoom 4</_short>
56@@ -157,9 +157,9 @@
57 <_short>Specific Zoom 5</_short>
58 <_long>Zoom level to go to when triggering hotkey 5</_long>
59 <default>1.0</default>
60- <min>0.1</min>
61- <max>1.0</max>
62- <precision>0.01</precision>
63+ <min>1.0</min>
64+ <max>10.0</max>
65+ <precision>0.1</precision>
66 </option>
67 <option type="key" name="zoom_specific_5_key">
68 <_short>Zoom to Specific Zoom 5</_short>
69@@ -170,9 +170,9 @@
70 <_short>Specific Zoom 6</_short>
71 <_long>Zoom level to go to when triggering hotkey 6</_long>
72 <default>1.0</default>
73- <min>0.1</min>
74- <max>1.0</max>
75- <precision>0.01</precision>
76+ <min>1.0</min>
77+ <max>10.0</max>
78+ <precision>0.1</precision>
79 </option>
80 <option type="key" name="zoom_specific_6_key">
81 <_short>Zoom to Specific Zoom 6</_short>
82@@ -183,9 +183,9 @@
83 <_short>Specific Zoom 7</_short>
84 <_long>Zoom level to go to when triggering hotkey 7</_long>
85 <default>1.0</default>
86- <min>0.1</min>
87- <max>1.0</max>
88- <precision>0.01</precision>
89+ <min>1.0</min>
90+ <max>10.0</max>
91+ <precision>0.1</precision>
92 </option>
93 <option type="key" name="zoom_specific_7_key">
94 <_short>Zoom to Specific Zoom 7</_short>
95@@ -196,9 +196,9 @@
96 <_short>Specific Zoom 8</_short>
97 <_long>Zoom level to go to when triggering hotkey 8</_long>
98 <default>1.0</default>
99- <min>0.1</min>
100- <max>1.0</max>
101- <precision>0.01</precision>
102+ <min>1.0</min>
103+ <max>10.0</max>
104+ <precision>0.1</precision>
105 </option>
106 <option type="key" name="zoom_specific_8_key">
107 <_short>Zoom to Specific Zoom 8</_short>
108@@ -209,9 +209,9 @@
109 <_short>Specific Zoom 9</_short>
110 <_long>Zoom level to go to when triggering hotkey 9</_long>
111 <default>1.0</default>
112- <min>0.1</min>
113- <max>1.0</max>
114- <precision>0.01</precision>
115+ <min>1.0</min>
116+ <max>10.0</max>
117+ <precision>0.1</precision>
118 </option>
119 <option type="key" name="zoom_specific_9_key">
120 <_short>Zoom to Specific Zoom 9</_short>
121@@ -222,9 +222,9 @@
122 <_short>Specific Zoom 10</_short>
123 <_long>Zoom level to go to when triggering hotkey 10</_long>
124 <default>1.0</default>
125- <min>0.1</min>
126- <max>1.0</max>
127- <precision>0.01</precision>
128+ <min>1.0</min>
129+ <max>10.0</max>
130+ <precision>0.1</precision>
131 </option>
132 <option type="key" name="zoom_specific_10_key">
133 <_short>Zoom to Specific Zoom 10</_short>
134@@ -235,9 +235,9 @@
135 <_short>Specific Zoom 11</_short>
136 <_long>Zoom level to go to when triggering hotkey 11</_long>
137 <default>1.0</default>
138- <min>0.1</min>
139- <max>1.0</max>
140- <precision>0.01</precision>
141+ <min>1.0</min>
142+ <max>10.0</max>
143+ <precision>0.1</precision>
144 </option>
145 <option type="key" name="zoom_specific_11_key">
146 <_short>Zoom to Specific Zoom 11</_short>
147@@ -248,9 +248,9 @@
148 <_short>Specific Zoom 12</_short>
149 <_long>Zoom level to go to when triggering hotkey 12</_long>
150 <default>1.0</default>
151- <min>0.1</min>
152- <max>1.0</max>
153- <precision>0.01</precision>
154+ <min>1.0</min>
155+ <max>10.0</max>
156+ <precision>0.1</precision>
157 </option>
158 <option type="key" name="zoom_specific_12_key">
159 <_short>Zoom to Specific Zoom 12</_short>
160@@ -261,9 +261,9 @@
161 <_short>Specific Zoom 13</_short>
162 <_long>Zoom level to go to when triggering hotkey 13</_long>
163 <default>1.0</default>
164- <min>0.1</min>
165- <max>1.0</max>
166- <precision>0.01</precision>
167+ <min>1.0</min>
168+ <max>10.0</max>
169+ <precision>0.1</precision>
170 </option>
171 <option type="key" name="zoom_specific_13_key">
172 <_short>Zoom to Specific Zoom 13</_short>
173@@ -274,9 +274,9 @@
174 <_short>Specific Zoom 14</_short>
175 <_long>Zoom level to go to when triggering hotkey 14</_long>
176 <default>1.0</default>
177- <min>0.1</min>
178- <max>1.0</max>
179- <precision>0.01</precision>
180+ <min>1.0</min>
181+ <max>10.0</max>
182+ <precision>0.1</precision>
183 </option>
184 <option type="key" name="zoom_specific_14_key">
185 <_short>Zoom to Specific Zoom 14</_short>
186@@ -287,9 +287,9 @@
187 <_short>Specific Zoom 15</_short>
188 <_long>Zoom level to go to when triggering hotkey 15</_long>
189 <default>1.0</default>
190- <min>0.1</min>
191- <max>1.0</max>
192- <precision>0.01</precision>
193+ <min>1.0</min>
194+ <max>10.0</max>
195+ <precision>0.1</precision>
196 </option>
197 <option type="key" name="zoom_specific_15_key">
198 <_short>Zoom to Specific Zoom 15</_short>
199@@ -300,9 +300,9 @@
200 <_short>Specific Zoom 16</_short>
201 <_long>Zoom level to go to when triggering hotkey 16</_long>
202 <default>1.0</default>
203- <min>0.1</min>
204- <max>1.0</max>
205- <precision>0.01</precision>
206+ <min>1.0</min>
207+ <max>10.0</max>
208+ <precision>0.1</precision>
209 </option>
210 <option type="key" name="zoom_specific_16_key">
211 <_short>Zoom to Specific Zoom 16</_short>
212@@ -360,13 +360,13 @@
213 <max>3</max>
214 <precision>0.01</precision>
215 </option>
216- <option type="float" name="minimum_zoom">
217- <_short>Minimum zoom factor</_short>
218- <_long>The minimum allowed zoom factor. A value of 0.5 equals 2x zoom, a value of 0.25 equals 4x zoom.</_long>
219- <default>0.125</default>
220- <min>0.000001</min>
221- <max>0.999999</max>
222- <precision>0.0001</precision>
223+ <option type="float" name="maximum_zoom">
224+ <_short>Maximum zoom factor</_short>
225+ <_long>The maximum allowed zoom factor. Zoom will not go further than this value eg: 8x.</_long>
226+ <default>15</default>
227+ <min>2</min>
228+ <max>50</max>
229+ <precision>0.1</precision>
230 </option>
231 </group>
232 <group>
233@@ -448,13 +448,13 @@
234 <_long>Fit the zoomed area to the window when the zoomed area moves as a result of focus tracking.</_long>
235 <default>false</default>
236 </option>
237- <option type="float" name="autoscale_min">
238+ <option type="float" name="autoscale_max">
239 <_short>Autoscale threshold</_short>
240- <_long>Only change zoom level (scale) on focus change if the target value is higher than this. Prevents zooming too far in on small popups etc.</_long>
241- <default>0.25</default>
242- <min>0.000001</min>
243- <max>0.999999</max>
244- <precision>0.0001</precision>
245+ <_long>Only change zoom level (scale) on focus change if we don't zoom more than that value. Prevents zooming too far in on small popups etc.</_long>
246+ <default>4</default>
247+ <min>2</min>
248+ <max>50</max>
249+ <precision>0.1</precision>
250 </option>
251 <option type="bool" name="always_focus_fit_window">
252 <_short>Always fit to window on focus track</_short>
253
254=== modified file 'plugins/ezoom/src/ezoom.cpp'
255--- plugins/ezoom/src/ezoom.cpp 2017-12-05 14:45:06 +0000
256+++ plugins/ezoom/src/ezoom.cpp 2018-04-13 12:07:16 +0000
257@@ -736,8 +736,8 @@
258 cursorZoomInactive ();
259 }
260
261- if (value < optionGetMinimumZoom ())
262- value = optionGetMinimumZoom ();
263+ if (value < 1.0f / optionGetMaximumZoom())
264+ value = 1.0f / optionGetMaximumZoom();
265
266 zooms.at (out).newZoom = value;
267 cScreen->damageScreen();
268@@ -1628,67 +1628,67 @@
269 switch (target)
270 {
271 case ZoomTarget1:
272- zoom_level = optionGetZoomSpecific1 ();
273+ zoom_level = 1.0f / optionGetZoomSpecific1 ();
274 break;
275
276 case ZoomTarget2:
277- zoom_level = optionGetZoomSpecific2 ();
278+ zoom_level = 1.0f / optionGetZoomSpecific2 ();
279 break;
280
281 case ZoomTarget3:
282- zoom_level = optionGetZoomSpecific3 ();
283+ zoom_level = 1.0f / optionGetZoomSpecific3 ();
284 break;
285
286 case ZoomTarget4:
287- zoom_level = optionGetZoomSpecific4 ();
288+ zoom_level = 1.0f / optionGetZoomSpecific4 ();
289 break;
290
291 case ZoomTarget5:
292- zoom_level = optionGetZoomSpecific5 ();
293+ zoom_level = 1.0f / optionGetZoomSpecific5 ();
294 break;
295
296 case ZoomTarget6:
297- zoom_level = optionGetZoomSpecific6 ();
298+ zoom_level = 1.0f / optionGetZoomSpecific6 ();
299 break;
300
301 case ZoomTarget7:
302- zoom_level = optionGetZoomSpecific7 ();
303+ zoom_level = 1.0f / optionGetZoomSpecific7 ();
304 break;
305
306 case ZoomTarget8:
307- zoom_level = optionGetZoomSpecific8 ();
308+ zoom_level = 1.0f / optionGetZoomSpecific8 ();
309 break;
310
311 case ZoomTarget9:
312- zoom_level = optionGetZoomSpecific9 ();
313+ zoom_level = 1.0f / optionGetZoomSpecific9 ();
314 break;
315
316 case ZoomTarget10:
317- zoom_level = optionGetZoomSpecific10 ();
318+ zoom_level = 1.0f / optionGetZoomSpecific10 ();
319 break;
320
321 case ZoomTarget11:
322- zoom_level = optionGetZoomSpecific11 ();
323+ zoom_level = 1.0f / optionGetZoomSpecific11 ();
324 break;
325
326 case ZoomTarget12:
327- zoom_level = optionGetZoomSpecific12 ();
328+ zoom_level = 1.0f / optionGetZoomSpecific12 ();
329 break;
330
331 case ZoomTarget13:
332- zoom_level = optionGetZoomSpecific13 ();
333+ zoom_level = 1.0f / optionGetZoomSpecific13 ();
334 break;
335
336 case ZoomTarget14:
337- zoom_level = optionGetZoomSpecific14 ();
338+ zoom_level = 1.0f / optionGetZoomSpecific14 ();
339 break;
340
341 case ZoomTarget15:
342- zoom_level = optionGetZoomSpecific15 ();
343+ zoom_level = 1.0f / optionGetZoomSpecific15 ();
344 break;
345
346 case ZoomTarget16:
347- zoom_level = optionGetZoomSpecific16 ();
348+ zoom_level = 1.0f / optionGetZoomSpecific16 ();
349 break;
350
351 default:
352@@ -1931,7 +1931,7 @@
353 float scale = MAX (width / static_cast <float> (screen->outputDevs ().at (out).width ()),
354 height / static_cast <float> (screen->outputDevs ().at (out).height ()));
355
356- if (scale > optionGetAutoscaleMin ())
357+ if (scale > 1.0f / optionGetAutoscaleMax ())
358 setScale (out, scale);
359 }
360

Subscribers

People subscribed via source and target branches