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

Proposed by Samuel thibault on 2018-04-13
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 (community) Needs Information on 2018-07-10
Compiz Maintainers 2018-04-13 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 on 2018-04-13

Inverse meaning of specific zoom level values

Alberts Muktupāvels (muktupavels) wrote :

Will not this break existing settings?

review: Needs Information
Samuel thibault (samuel-thibault) wrote :

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

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...

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

Alex ARNAUD (alexarnaud) wrote :
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.

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 on 2018-04-13

Inverse meaning of specific zoom level values

4144. By ksamak on 2018-04-13

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
=== modified file 'plugins/ezoom/ezoom.xml.in'
--- plugins/ezoom/ezoom.xml.in 2017-12-05 14:45:06 +0000
+++ plugins/ezoom/ezoom.xml.in 2018-04-13 12:07:16 +0000
@@ -105,9 +105,9 @@
105 <_short>Specific Zoom 1</_short>105 <_short>Specific Zoom 1</_short>
106 <_long>Zoom level to go to when triggering hotkey 1</_long>106 <_long>Zoom level to go to when triggering hotkey 1</_long>
107 <default>1.0</default>107 <default>1.0</default>
108 <min>0.1</min>108 <min>1.0</min>
109 <max>1.0</max>109 <max>10.0</max>
110 <precision>0.01</precision>110 <precision>0.1</precision>
111 </option>111 </option>
112 <option type="key" name="zoom_specific_1_key">112 <option type="key" name="zoom_specific_1_key">
113 <_short>Zoom to Specific Zoom 1</_short>113 <_short>Zoom to Specific Zoom 1</_short>
@@ -118,9 +118,9 @@
118 <_short>Specific Zoom 2</_short>118 <_short>Specific Zoom 2</_short>
119 <_long>Zoom level to go to when triggering hotkey 2</_long>119 <_long>Zoom level to go to when triggering hotkey 2</_long>
120 <default>1.0</default>120 <default>1.0</default>
121 <min>0.1</min>121 <min>1.0</min>
122 <max>1.0</max>122 <max>10.0</max>
123 <precision>0.01</precision>123 <precision>0.1</precision>
124 </option>124 </option>
125 <option type="key" name="zoom_specific_2_key">125 <option type="key" name="zoom_specific_2_key">
126 <_short>Zoom to Specific Zoom 2</_short>126 <_short>Zoom to Specific Zoom 2</_short>
@@ -131,9 +131,9 @@
131 <_short>Specific Zoom 3</_short>131 <_short>Specific Zoom 3</_short>
132 <_long>Zoom level to go to when triggering hotkey 3</_long>132 <_long>Zoom level to go to when triggering hotkey 3</_long>
133 <default>1.0</default>133 <default>1.0</default>
134 <min>0.1</min>134 <min>1.0</min>
135 <max>1.0</max>135 <max>10.0</max>
136 <precision>0.01</precision>136 <precision>0.1</precision>
137 </option>137 </option>
138 <option type="key" name="zoom_specific_3_key">138 <option type="key" name="zoom_specific_3_key">
139 <_short>Zoom to Specific Zoom 3</_short>139 <_short>Zoom to Specific Zoom 3</_short>
@@ -144,9 +144,9 @@
144 <_short>Specific Zoom 4</_short>144 <_short>Specific Zoom 4</_short>
145 <_long>Zoom level to go to when triggering hotkey 4</_long>145 <_long>Zoom level to go to when triggering hotkey 4</_long>
146 <default>1.0</default>146 <default>1.0</default>
147 <min>0.1</min>147 <min>1.0</min>
148 <max>1.0</max>148 <max>10.0</max>
149 <precision>0.01</precision>149 <precision>0.1</precision>
150 </option>150 </option>
151 <option type="key" name="zoom_specific_4_key">151 <option type="key" name="zoom_specific_4_key">
152 <_short>Zoom to Specific Zoom 4</_short>152 <_short>Zoom to Specific Zoom 4</_short>
@@ -157,9 +157,9 @@
157 <_short>Specific Zoom 5</_short>157 <_short>Specific Zoom 5</_short>
158 <_long>Zoom level to go to when triggering hotkey 5</_long>158 <_long>Zoom level to go to when triggering hotkey 5</_long>
159 <default>1.0</default>159 <default>1.0</default>
160 <min>0.1</min>160 <min>1.0</min>
161 <max>1.0</max>161 <max>10.0</max>
162 <precision>0.01</precision>162 <precision>0.1</precision>
163 </option>163 </option>
164 <option type="key" name="zoom_specific_5_key">164 <option type="key" name="zoom_specific_5_key">
165 <_short>Zoom to Specific Zoom 5</_short>165 <_short>Zoom to Specific Zoom 5</_short>
@@ -170,9 +170,9 @@
170 <_short>Specific Zoom 6</_short>170 <_short>Specific Zoom 6</_short>
171 <_long>Zoom level to go to when triggering hotkey 6</_long>171 <_long>Zoom level to go to when triggering hotkey 6</_long>
172 <default>1.0</default>172 <default>1.0</default>
173 <min>0.1</min>173 <min>1.0</min>
174 <max>1.0</max>174 <max>10.0</max>
175 <precision>0.01</precision>175 <precision>0.1</precision>
176 </option>176 </option>
177 <option type="key" name="zoom_specific_6_key">177 <option type="key" name="zoom_specific_6_key">
178 <_short>Zoom to Specific Zoom 6</_short>178 <_short>Zoom to Specific Zoom 6</_short>
@@ -183,9 +183,9 @@
183 <_short>Specific Zoom 7</_short>183 <_short>Specific Zoom 7</_short>
184 <_long>Zoom level to go to when triggering hotkey 7</_long>184 <_long>Zoom level to go to when triggering hotkey 7</_long>
185 <default>1.0</default>185 <default>1.0</default>
186 <min>0.1</min>186 <min>1.0</min>
187 <max>1.0</max>187 <max>10.0</max>
188 <precision>0.01</precision>188 <precision>0.1</precision>
189 </option>189 </option>
190 <option type="key" name="zoom_specific_7_key">190 <option type="key" name="zoom_specific_7_key">
191 <_short>Zoom to Specific Zoom 7</_short>191 <_short>Zoom to Specific Zoom 7</_short>
@@ -196,9 +196,9 @@
196 <_short>Specific Zoom 8</_short>196 <_short>Specific Zoom 8</_short>
197 <_long>Zoom level to go to when triggering hotkey 8</_long>197 <_long>Zoom level to go to when triggering hotkey 8</_long>
198 <default>1.0</default>198 <default>1.0</default>
199 <min>0.1</min>199 <min>1.0</min>
200 <max>1.0</max>200 <max>10.0</max>
201 <precision>0.01</precision>201 <precision>0.1</precision>
202 </option>202 </option>
203 <option type="key" name="zoom_specific_8_key">203 <option type="key" name="zoom_specific_8_key">
204 <_short>Zoom to Specific Zoom 8</_short>204 <_short>Zoom to Specific Zoom 8</_short>
@@ -209,9 +209,9 @@
209 <_short>Specific Zoom 9</_short>209 <_short>Specific Zoom 9</_short>
210 <_long>Zoom level to go to when triggering hotkey 9</_long>210 <_long>Zoom level to go to when triggering hotkey 9</_long>
211 <default>1.0</default>211 <default>1.0</default>
212 <min>0.1</min>212 <min>1.0</min>
213 <max>1.0</max>213 <max>10.0</max>
214 <precision>0.01</precision>214 <precision>0.1</precision>
215 </option>215 </option>
216 <option type="key" name="zoom_specific_9_key">216 <option type="key" name="zoom_specific_9_key">
217 <_short>Zoom to Specific Zoom 9</_short>217 <_short>Zoom to Specific Zoom 9</_short>
@@ -222,9 +222,9 @@
222 <_short>Specific Zoom 10</_short>222 <_short>Specific Zoom 10</_short>
223 <_long>Zoom level to go to when triggering hotkey 10</_long>223 <_long>Zoom level to go to when triggering hotkey 10</_long>
224 <default>1.0</default>224 <default>1.0</default>
225 <min>0.1</min>225 <min>1.0</min>
226 <max>1.0</max>226 <max>10.0</max>
227 <precision>0.01</precision>227 <precision>0.1</precision>
228 </option>228 </option>
229 <option type="key" name="zoom_specific_10_key">229 <option type="key" name="zoom_specific_10_key">
230 <_short>Zoom to Specific Zoom 10</_short>230 <_short>Zoom to Specific Zoom 10</_short>
@@ -235,9 +235,9 @@
235 <_short>Specific Zoom 11</_short>235 <_short>Specific Zoom 11</_short>
236 <_long>Zoom level to go to when triggering hotkey 11</_long>236 <_long>Zoom level to go to when triggering hotkey 11</_long>
237 <default>1.0</default>237 <default>1.0</default>
238 <min>0.1</min>238 <min>1.0</min>
239 <max>1.0</max>239 <max>10.0</max>
240 <precision>0.01</precision>240 <precision>0.1</precision>
241 </option>241 </option>
242 <option type="key" name="zoom_specific_11_key">242 <option type="key" name="zoom_specific_11_key">
243 <_short>Zoom to Specific Zoom 11</_short>243 <_short>Zoom to Specific Zoom 11</_short>
@@ -248,9 +248,9 @@
248 <_short>Specific Zoom 12</_short>248 <_short>Specific Zoom 12</_short>
249 <_long>Zoom level to go to when triggering hotkey 12</_long>249 <_long>Zoom level to go to when triggering hotkey 12</_long>
250 <default>1.0</default>250 <default>1.0</default>
251 <min>0.1</min>251 <min>1.0</min>
252 <max>1.0</max>252 <max>10.0</max>
253 <precision>0.01</precision>253 <precision>0.1</precision>
254 </option>254 </option>
255 <option type="key" name="zoom_specific_12_key">255 <option type="key" name="zoom_specific_12_key">
256 <_short>Zoom to Specific Zoom 12</_short>256 <_short>Zoom to Specific Zoom 12</_short>
@@ -261,9 +261,9 @@
261 <_short>Specific Zoom 13</_short>261 <_short>Specific Zoom 13</_short>
262 <_long>Zoom level to go to when triggering hotkey 13</_long>262 <_long>Zoom level to go to when triggering hotkey 13</_long>
263 <default>1.0</default>263 <default>1.0</default>
264 <min>0.1</min>264 <min>1.0</min>
265 <max>1.0</max>265 <max>10.0</max>
266 <precision>0.01</precision>266 <precision>0.1</precision>
267 </option>267 </option>
268 <option type="key" name="zoom_specific_13_key">268 <option type="key" name="zoom_specific_13_key">
269 <_short>Zoom to Specific Zoom 13</_short>269 <_short>Zoom to Specific Zoom 13</_short>
@@ -274,9 +274,9 @@
274 <_short>Specific Zoom 14</_short>274 <_short>Specific Zoom 14</_short>
275 <_long>Zoom level to go to when triggering hotkey 14</_long>275 <_long>Zoom level to go to when triggering hotkey 14</_long>
276 <default>1.0</default>276 <default>1.0</default>
277 <min>0.1</min>277 <min>1.0</min>
278 <max>1.0</max>278 <max>10.0</max>
279 <precision>0.01</precision>279 <precision>0.1</precision>
280 </option>280 </option>
281 <option type="key" name="zoom_specific_14_key">281 <option type="key" name="zoom_specific_14_key">
282 <_short>Zoom to Specific Zoom 14</_short>282 <_short>Zoom to Specific Zoom 14</_short>
@@ -287,9 +287,9 @@
287 <_short>Specific Zoom 15</_short>287 <_short>Specific Zoom 15</_short>
288 <_long>Zoom level to go to when triggering hotkey 15</_long>288 <_long>Zoom level to go to when triggering hotkey 15</_long>
289 <default>1.0</default>289 <default>1.0</default>
290 <min>0.1</min>290 <min>1.0</min>
291 <max>1.0</max>291 <max>10.0</max>
292 <precision>0.01</precision>292 <precision>0.1</precision>
293 </option>293 </option>
294 <option type="key" name="zoom_specific_15_key">294 <option type="key" name="zoom_specific_15_key">
295 <_short>Zoom to Specific Zoom 15</_short>295 <_short>Zoom to Specific Zoom 15</_short>
@@ -300,9 +300,9 @@
300 <_short>Specific Zoom 16</_short>300 <_short>Specific Zoom 16</_short>
301 <_long>Zoom level to go to when triggering hotkey 16</_long>301 <_long>Zoom level to go to when triggering hotkey 16</_long>
302 <default>1.0</default>302 <default>1.0</default>
303 <min>0.1</min>303 <min>1.0</min>
304 <max>1.0</max>304 <max>10.0</max>
305 <precision>0.01</precision>305 <precision>0.1</precision>
306 </option>306 </option>
307 <option type="key" name="zoom_specific_16_key">307 <option type="key" name="zoom_specific_16_key">
308 <_short>Zoom to Specific Zoom 16</_short>308 <_short>Zoom to Specific Zoom 16</_short>
@@ -360,13 +360,13 @@
360 <max>3</max>360 <max>3</max>
361 <precision>0.01</precision>361 <precision>0.01</precision>
362 </option>362 </option>
363 <option type="float" name="minimum_zoom">363 <option type="float" name="maximum_zoom">
364 <_short>Minimum zoom factor</_short>364 <_short>Maximum zoom factor</_short>
365 <_long>The minimum allowed zoom factor. A value of 0.5 equals 2x zoom, a value of 0.25 equals 4x zoom.</_long>365 <_long>The maximum allowed zoom factor. Zoom will not go further than this value eg: 8x.</_long>
366 <default>0.125</default>366 <default>15</default>
367 <min>0.000001</min>367 <min>2</min>
368 <max>0.999999</max>368 <max>50</max>
369 <precision>0.0001</precision>369 <precision>0.1</precision>
370 </option>370 </option>
371 </group>371 </group>
372 <group>372 <group>
@@ -448,13 +448,13 @@
448 <_long>Fit the zoomed area to the window when the zoomed area moves as a result of focus tracking.</_long>448 <_long>Fit the zoomed area to the window when the zoomed area moves as a result of focus tracking.</_long>
449 <default>false</default>449 <default>false</default>
450 </option>450 </option>
451 <option type="float" name="autoscale_min">451 <option type="float" name="autoscale_max">
452 <_short>Autoscale threshold</_short>452 <_short>Autoscale threshold</_short>
453 <_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>453 <_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>
454 <default>0.25</default>454 <default>4</default>
455 <min>0.000001</min>455 <min>2</min>
456 <max>0.999999</max>456 <max>50</max>
457 <precision>0.0001</precision>457 <precision>0.1</precision>
458 </option>458 </option>
459 <option type="bool" name="always_focus_fit_window">459 <option type="bool" name="always_focus_fit_window">
460 <_short>Always fit to window on focus track</_short>460 <_short>Always fit to window on focus track</_short>
461461
=== modified file 'plugins/ezoom/src/ezoom.cpp'
--- plugins/ezoom/src/ezoom.cpp 2017-12-05 14:45:06 +0000
+++ plugins/ezoom/src/ezoom.cpp 2018-04-13 12:07:16 +0000
@@ -736,8 +736,8 @@
736 cursorZoomInactive ();736 cursorZoomInactive ();
737 }737 }
738738
739 if (value < optionGetMinimumZoom ())739 if (value < 1.0f / optionGetMaximumZoom())
740 value = optionGetMinimumZoom ();740 value = 1.0f / optionGetMaximumZoom();
741741
742 zooms.at (out).newZoom = value;742 zooms.at (out).newZoom = value;
743 cScreen->damageScreen();743 cScreen->damageScreen();
@@ -1628,67 +1628,67 @@
1628 switch (target)1628 switch (target)
1629 {1629 {
1630 case ZoomTarget1:1630 case ZoomTarget1:
1631 zoom_level = optionGetZoomSpecific1 ();1631 zoom_level = 1.0f / optionGetZoomSpecific1 ();
1632 break;1632 break;
16331633
1634 case ZoomTarget2:1634 case ZoomTarget2:
1635 zoom_level = optionGetZoomSpecific2 ();1635 zoom_level = 1.0f / optionGetZoomSpecific2 ();
1636 break;1636 break;
16371637
1638 case ZoomTarget3:1638 case ZoomTarget3:
1639 zoom_level = optionGetZoomSpecific3 ();1639 zoom_level = 1.0f / optionGetZoomSpecific3 ();
1640 break;1640 break;
16411641
1642 case ZoomTarget4:1642 case ZoomTarget4:
1643 zoom_level = optionGetZoomSpecific4 ();1643 zoom_level = 1.0f / optionGetZoomSpecific4 ();
1644 break;1644 break;
16451645
1646 case ZoomTarget5:1646 case ZoomTarget5:
1647 zoom_level = optionGetZoomSpecific5 ();1647 zoom_level = 1.0f / optionGetZoomSpecific5 ();
1648 break;1648 break;
16491649
1650 case ZoomTarget6:1650 case ZoomTarget6:
1651 zoom_level = optionGetZoomSpecific6 ();1651 zoom_level = 1.0f / optionGetZoomSpecific6 ();
1652 break;1652 break;
16531653
1654 case ZoomTarget7:1654 case ZoomTarget7:
1655 zoom_level = optionGetZoomSpecific7 ();1655 zoom_level = 1.0f / optionGetZoomSpecific7 ();
1656 break;1656 break;
16571657
1658 case ZoomTarget8:1658 case ZoomTarget8:
1659 zoom_level = optionGetZoomSpecific8 ();1659 zoom_level = 1.0f / optionGetZoomSpecific8 ();
1660 break;1660 break;
16611661
1662 case ZoomTarget9:1662 case ZoomTarget9:
1663 zoom_level = optionGetZoomSpecific9 ();1663 zoom_level = 1.0f / optionGetZoomSpecific9 ();
1664 break;1664 break;
16651665
1666 case ZoomTarget10:1666 case ZoomTarget10:
1667 zoom_level = optionGetZoomSpecific10 ();1667 zoom_level = 1.0f / optionGetZoomSpecific10 ();
1668 break;1668 break;
16691669
1670 case ZoomTarget11:1670 case ZoomTarget11:
1671 zoom_level = optionGetZoomSpecific11 ();1671 zoom_level = 1.0f / optionGetZoomSpecific11 ();
1672 break;1672 break;
16731673
1674 case ZoomTarget12:1674 case ZoomTarget12:
1675 zoom_level = optionGetZoomSpecific12 ();1675 zoom_level = 1.0f / optionGetZoomSpecific12 ();
1676 break;1676 break;
16771677
1678 case ZoomTarget13:1678 case ZoomTarget13:
1679 zoom_level = optionGetZoomSpecific13 ();1679 zoom_level = 1.0f / optionGetZoomSpecific13 ();
1680 break;1680 break;
16811681
1682 case ZoomTarget14:1682 case ZoomTarget14:
1683 zoom_level = optionGetZoomSpecific14 ();1683 zoom_level = 1.0f / optionGetZoomSpecific14 ();
1684 break;1684 break;
16851685
1686 case ZoomTarget15:1686 case ZoomTarget15:
1687 zoom_level = optionGetZoomSpecific15 ();1687 zoom_level = 1.0f / optionGetZoomSpecific15 ();
1688 break;1688 break;
16891689
1690 case ZoomTarget16:1690 case ZoomTarget16:
1691 zoom_level = optionGetZoomSpecific16 ();1691 zoom_level = 1.0f / optionGetZoomSpecific16 ();
1692 break;1692 break;
16931693
1694 default:1694 default:
@@ -1931,7 +1931,7 @@
1931 float scale = MAX (width / static_cast <float> (screen->outputDevs ().at (out).width ()),1931 float scale = MAX (width / static_cast <float> (screen->outputDevs ().at (out).width ()),
1932 height / static_cast <float> (screen->outputDevs ().at (out).height ()));1932 height / static_cast <float> (screen->outputDevs ().at (out).height ()));
19331933
1934 if (scale > optionGetAutoscaleMin ())1934 if (scale > 1.0f / optionGetAutoscaleMax ())
1935 setScale (out, scale);1935 setScale (out, scale);
1936 }1936 }
19371937

Subscribers

People subscribed via source and target branches