Merge lp:~hikiko/compiz/compiz.expo-scale-options-skip-anim-steps into lp:compiz

Proposed by Eleni Maria Stea on 2016-06-30
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2016-06-30
Approved revision: 4046
Merged at revision: 4066
Proposed branch: lp:~hikiko/compiz/compiz.expo-scale-options-skip-anim-steps
Merge into: lp:compiz
Diff against target: 85 lines (+27/-8)
4 files modified
plugins/expo/expo.xml.in (+5/-1)
plugins/expo/src/expo.cpp (+12/-4)
plugins/scale/scale.xml.in (+5/-0)
plugins/scale/src/scale.cpp (+5/-3)
To merge this branch: bzr merge lp:~hikiko/compiz/compiz.expo-scale-options-skip-anim-steps
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2016-06-30 Approve on 2016-06-30
PS Jenkins bot continuous-integration Pending
Unity Team 2016-06-30 Pending
Review via email: mp+298737@code.launchpad.net

Commit Message

Added options for no animation in expo and scale plugins. They skip the intermediate fading steps that force several redraws.

Description of the Change

Added options for no animation in expo and scale plugins. They skip the intermediate fading steps that force several redraws.

To post a comment you must log in.
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks

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 2016-05-10 07:21:00 +0000
3+++ plugins/expo/expo.xml.in 2016-06-30 05:21:32 +0000
4@@ -95,7 +95,7 @@
5 <_long>The animation used when initiating or leaving Expo.</_long>
6 <default>0</default>
7 <min>0</min>
8- <max>2</max>
9+ <max>3</max>
10 <desc>
11 <value>0</value>
12 <_name>Zoom</_name>
13@@ -108,6 +108,10 @@
14 <value>2</value>
15 <_name>Vortex</_name>
16 </desc>
17+ <desc>
18+ <value>3</value>
19+ <_name>None</_name>
20+ </desc>
21 </option>
22 </group>
23 <group>
24
25=== modified file 'plugins/expo/src/expo.cpp'
26--- plugins/expo/src/expo.cpp 2016-05-16 06:23:55 +0000
27+++ plugins/expo/src/expo.cpp 2016-06-30 05:21:32 +0000
28@@ -402,10 +402,18 @@
29 float val = (static_cast <float> (msSinceLastPaint) / 1000.0f) /
30 optionGetZoomTime ();
31
32- if (expoMode)
33- expoCam = MIN (1.0, expoCam + val);
34- else
35- expoCam = MAX (0.0, expoCam - val);
36+ if (optionGetExpoAnimation() != ExpoScreen::ExpoAnimationNone) {
37+ if (expoMode)
38+ expoCam = MIN (1.0, expoCam + val);
39+ else
40+ expoCam = MAX (0.0, expoCam - val);
41+ }
42+ else {
43+ if (expoMode)
44+ expoCam = 1;
45+ else
46+ expoCam = 0;
47+ }
48
49 if (expoCam)
50 {
51
52=== modified file 'plugins/scale/scale.xml.in'
53--- plugins/scale/scale.xml.in 2016-04-27 15:47:55 +0000
54+++ plugins/scale/scale.xml.in 2016-06-30 05:21:32 +0000
55@@ -139,6 +139,11 @@
56 <_name>On all output devices</_name>
57 </desc>
58 </option>
59+ <option name="skip_animation" type="bool">
60+ <_short>Skip Animation</_short>
61+ <_long>Skips the scale plugin animation.</_long>
62+ <default>false</default>
63+ </option>
64 </group>
65 <group>
66 <_short>Bindings</_short>
67
68=== modified file 'plugins/scale/src/scale.cpp'
69--- plugins/scale/src/scale.cpp 2016-05-17 02:53:00 +0000
70+++ plugins/scale/src/scale.cpp 2016-06-30 05:21:32 +0000
71@@ -932,9 +932,11 @@
72 if (state != ScaleScreen::Idle && state != ScaleScreen::Wait)
73 {
74 int steps;
75- float amount, chunk;
76-
77- amount = msSinceLastPaint * 0.05f * optionGetSpeed ();
78+ float amount, chunk, speed;
79+
80+ speed = optionGetSkipAnimation() ? USHRT_MAX : optionGetSpeed();
81+
82+ amount = msSinceLastPaint * 0.05f * speed;
83 steps = amount / (0.5f * optionGetTimestep ());
84
85 if (!steps)

Subscribers

People subscribed via source and target branches