Merge lp:~unity-team/unity/unity.dont-emit-on-id-change into lp:unity
- unity.dont-emit-on-id-change
- Merge into trunk
Proposed by
Jason Smith
Status: | Merged |
---|---|
Approved by: | Jason Smith |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1885 |
Proposed branch: | lp:~unity-team/unity/unity.dont-emit-on-id-change |
Merge into: | lp:unity |
Diff against target: |
658 lines (+84/-224) 9 files modified
plugins/unityshell/src/Launcher.cpp (+34/-106) plugins/unityshell/src/Launcher.h (+4/-17) plugins/unityshell/src/LauncherController.cpp (+0/-13) plugins/unityshell/src/LauncherOptions.cpp (+28/-63) plugins/unityshell/src/LauncherOptions.h (+1/-13) plugins/unityshell/src/PointerBarrier.cpp (+3/-11) plugins/unityshell/src/PointerBarrier.h (+2/-0) plugins/unityshell/src/unityshell.cpp (+4/-1) plugins/unityshell/unityshell.xml.in (+8/-0) |
To merge this branch: | bzr merge lp:~unity-team/unity/unity.dont-emit-on-id-change |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Carr (community) | Approve | ||
Gord Allott (community) | Approve | ||
Review via email: mp+90923@code.launchpad.net |
Commit message
Description of the change
UNBLOCK
Fixes launcher reveal for some people
To post a comment you must log in.
Revision history for this message
Gord Allott (gordallott) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'plugins/unityshell/src/Launcher.cpp' |
2 | --- plugins/unityshell/src/Launcher.cpp 2012-01-31 11:26:07 +0000 |
3 | +++ plugins/unityshell/src/Launcher.cpp 2012-02-01 01:11:26 +0000 |
4 | @@ -199,9 +199,6 @@ |
5 | _launcher_bottom_y = 0; |
6 | _folded_z_distance = 10.0f; |
7 | _launcher_action_state = ACTION_NONE; |
8 | - _launch_animation = LAUNCH_ANIMATION_NONE; |
9 | - _urgent_animation = URGENT_ANIMATION_NONE; |
10 | - _autohide_animation = FADE_AND_SLIDE; |
11 | _hidemode = LAUNCHER_HIDE_NEVER; |
12 | _icon_under_mouse = NULL; |
13 | _icon_mouse_down = NULL; |
14 | @@ -210,7 +207,6 @@ |
15 | _icon_glow_size = 62; |
16 | _icon_image_size_delta = 6; |
17 | _icon_size = _icon_image_size + _icon_image_size_delta; |
18 | - _background_alpha = 0.6667; // about 0xAA |
19 | |
20 | _enter_y = 0; |
21 | _launcher_drag_delta = 0; |
22 | @@ -222,16 +218,15 @@ |
23 | _dnd_check_handle = 0; |
24 | |
25 | _shortcuts_shown = false; |
26 | - _floating = false; |
27 | _hovered = false; |
28 | _hidden = false; |
29 | _render_drag_window = false; |
30 | _drag_edge_touching = false; |
31 | - _backlight_mode = BACKLIGHT_NORMAL; |
32 | _last_button_press = 0; |
33 | _selection_atom = 0; |
34 | _drag_out_id = 0; |
35 | _drag_out_delta_x = 0.0f; |
36 | + _edge_overcome_pressure = 0.0f; |
37 | |
38 | // FIXME: remove |
39 | _initial_drag_animation = false; |
40 | @@ -404,7 +399,6 @@ |
41 | .add("dnd-exit-progress", DnDExitProgress(current)) |
42 | .add("autohide-progress", AutohideProgress(current)) |
43 | .add("dnd-delta", _dnd_delta_y) |
44 | - .add("floating", _floating) |
45 | .add("hovered", _hovered) |
46 | .add("hidemode", _hidemode) |
47 | .add("hidden", _hidden) |
48 | @@ -609,7 +603,7 @@ |
49 | /* Min is when you are on the trigger */ |
50 | float Launcher::GetAutohidePositionMin() const |
51 | { |
52 | - if (_autohide_animation == SLIDE_ONLY || _autohide_animation == FADE_AND_SLIDE) |
53 | + if (options()->auto_hide_animation() == SLIDE_ONLY || options()->auto_hide_animation() == FADE_AND_SLIDE) |
54 | return 0.35f; |
55 | else |
56 | return 0.25f; |
57 | @@ -617,7 +611,7 @@ |
58 | /* Max is the initial state over the bfb */ |
59 | float Launcher::GetAutohidePositionMax() const |
60 | { |
61 | - if (_autohide_animation == SLIDE_ONLY || _autohide_animation == FADE_AND_SLIDE) |
62 | + if (options()->auto_hide_animation() == SLIDE_ONLY || options()->auto_hide_animation() == FADE_AND_SLIDE) |
63 | return 1.00f; |
64 | else |
65 | return 0.75f; |
66 | @@ -684,7 +678,7 @@ |
67 | int urgent_ms = unity::TimeUtil::TimeDelta(¤t, &urgent_time); |
68 | float result; |
69 | |
70 | - if (_urgent_animation == URGENT_ANIMATION_WIGGLE) |
71 | + if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE) |
72 | result = CLAMP((float) urgent_ms / (float)(ANIM_DURATION_SHORT * WIGGLE_CYCLES), 0.0f, 1.0f); |
73 | else |
74 | result = CLAMP((float) urgent_ms / (float)(ANIM_DURATION_LONG * URGENT_BLINKS * 2), 0.0f, 1.0f); |
75 | @@ -803,22 +797,22 @@ |
76 | icon->SetQuirk(AbstractLauncherIcon::QUIRK_STARTING, false); |
77 | |
78 | float backlight_strength; |
79 | - if (_backlight_mode == BACKLIGHT_ALWAYS_ON) |
80 | + if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON) |
81 | backlight_strength = BACKLIGHT_STRENGTH; |
82 | else if (IsBackLightModeToggles()) |
83 | backlight_strength = BACKLIGHT_STRENGTH * running_progress; |
84 | else |
85 | backlight_strength = 0.0f; |
86 | |
87 | - switch (_launch_animation) |
88 | + switch (options()->launch_animation()) |
89 | { |
90 | case LAUNCH_ANIMATION_NONE: |
91 | result = backlight_strength; |
92 | break; |
93 | case LAUNCH_ANIMATION_BLINK: |
94 | - if (_backlight_mode == BACKLIGHT_ALWAYS_ON) |
95 | + if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON) |
96 | result = IconStartingBlinkValue(icon, current); |
97 | - else if (_backlight_mode == BACKLIGHT_ALWAYS_OFF) |
98 | + else if (options()->backlight_mode() == BACKLIGHT_ALWAYS_OFF) |
99 | result = 1.0f - IconStartingBlinkValue(icon, current); |
100 | else |
101 | result = backlight_strength; // The blink concept is a failure in this case (it just doesn't work right) |
102 | @@ -828,7 +822,7 @@ |
103 | icon->ResetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING); |
104 | |
105 | result = backlight_strength; |
106 | - if (_backlight_mode == BACKLIGHT_ALWAYS_ON) |
107 | + if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON) |
108 | result *= CLAMP(running_progress + IconStartingPulseValue(icon, current), 0.0f, 1.0f); |
109 | else if (IsBackLightModeToggles()) |
110 | result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconStartingPulseValue(icon, current)); |
111 | @@ -839,16 +833,16 @@ |
112 | |
113 | if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PULSE_ONCE)) |
114 | { |
115 | - if (_backlight_mode == BACKLIGHT_ALWAYS_ON) |
116 | + if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON) |
117 | result *= CLAMP(running_progress + IconPulseOnceValue(icon, current), 0.0f, 1.0f); |
118 | - else if (_backlight_mode == BACKLIGHT_NORMAL) |
119 | + else if (options()->backlight_mode() == BACKLIGHT_NORMAL) |
120 | result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconPulseOnceValue(icon, current)); |
121 | else |
122 | result = 1.0f - CLAMP(running_progress + IconPulseOnceValue(icon, current), 0.0f, 1.0f); |
123 | } |
124 | |
125 | // urgent serves to bring the total down only |
126 | - if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && _urgent_animation == URGENT_ANIMATION_PULSE) |
127 | + if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && options()->urgent_animation() == URGENT_ANIMATION_PULSE) |
128 | result *= 0.2f + 0.8f * IconUrgentPulseValue(icon, current); |
129 | |
130 | return result; |
131 | @@ -868,10 +862,10 @@ |
132 | |
133 | bool Launcher::IconDrawEdgeOnly(AbstractLauncherIcon* icon) const |
134 | { |
135 | - if (_backlight_mode == BACKLIGHT_EDGE_TOGGLE) |
136 | + if (options()->backlight_mode() == BACKLIGHT_EDGE_TOGGLE) |
137 | return true; |
138 | |
139 | - if (_backlight_mode == BACKLIGHT_NORMAL_EDGE_TOGGLE && !icon->WindowVisibleOnMonitor(monitor)) |
140 | + if (options()->backlight_mode() == BACKLIGHT_NORMAL_EDGE_TOGGLE && !icon->WindowVisibleOnMonitor(monitor)) |
141 | return true; |
142 | |
143 | return false; |
144 | @@ -938,7 +932,7 @@ |
145 | urgent_progress = CLAMP(urgent_progress * 3.0f - 2.0f, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle |
146 | arg.glow_intensity = urgent_progress; |
147 | |
148 | - if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && _urgent_animation == URGENT_ANIMATION_WIGGLE) |
149 | + if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && options()->urgent_animation() == URGENT_ANIMATION_WIGGLE) |
150 | { |
151 | arg.z_rotation = IconUrgentWiggleValue(icon, current); |
152 | } |
153 | @@ -1101,7 +1095,7 @@ |
154 | { |
155 | |
156 | float autohide_progress = AutohideProgress(current) * (1.0f - DragOutProgress(current)); |
157 | - if (_autohide_animation == FADE_ONLY) |
158 | + if (options()->auto_hide_animation() == FADE_ONLY) |
159 | { |
160 | *launcher_alpha = 1.0f - autohide_progress; |
161 | } |
162 | @@ -1110,7 +1104,7 @@ |
163 | if (autohide_progress > 0.0f) |
164 | { |
165 | autohide_offset -= geo.width * autohide_progress; |
166 | - if (_autohide_animation == FADE_AND_SLIDE) |
167 | + if (options()->auto_hide_animation() == FADE_AND_SLIDE) |
168 | *launcher_alpha = 1.0f - 0.5f * autohide_progress; |
169 | } |
170 | } |
171 | @@ -1554,20 +1548,24 @@ |
172 | Launcher::UpdateOptions(Options::Ptr options) |
173 | { |
174 | SetHideMode(options->hide_mode); |
175 | - SetAutoHideAnimation(options->auto_hide_animation); |
176 | - SetFloating(options->floating); |
177 | - SetBacklightMode(options->backlight_mode); |
178 | - SetLaunchAnimation(options->launch_animation); |
179 | - SetUrgentAnimation(options->urgent_animation); |
180 | SetIconSize(options->tile_size, options->icon_size); |
181 | - decaymulator_->rate_of_decay = options->edge_decay_rate(); |
182 | + |
183 | + // make the effect half as strong as specified as other values shouldn't scale |
184 | + // as quickly as the max velocity multiplier |
185 | + float responsiveness_mult = ((options->edge_responsiveness() - 1) * .025) + 1; |
186 | + |
187 | + decaymulator_->rate_of_decay = options->edge_decay_rate() * responsiveness_mult; |
188 | + _edge_overcome_pressure = options->edge_overcome_pressure() * responsiveness_mult; |
189 | |
190 | _pointer_barrier->threshold = options->edge_stop_velocity(); |
191 | + _pointer_barrier->max_velocity_multiplier = options->edge_responsiveness(); |
192 | _pointer_barrier->DestroyBarrier(); |
193 | _pointer_barrier->ConstructBarrier(); |
194 | |
195 | - _hide_machine->reveal_pressure = options->edge_reveal_pressure(); |
196 | - _hide_machine->edge_decay_rate = options->edge_decay_rate(); |
197 | + _hide_machine->reveal_pressure = options->edge_reveal_pressure() * responsiveness_mult; |
198 | + _hide_machine->edge_decay_rate = options->edge_decay_rate() * responsiveness_mult; |
199 | + |
200 | + EnsureAnimation(); |
201 | } |
202 | |
203 | void Launcher::SetHideMode(LauncherHideMode hidemode) |
204 | @@ -1591,45 +1589,14 @@ |
205 | EnsureAnimation(); |
206 | } |
207 | |
208 | -AutoHideAnimation Launcher::GetAutoHideAnimation() const |
209 | -{ |
210 | - return _autohide_animation; |
211 | -} |
212 | - |
213 | -void Launcher::SetAutoHideAnimation(AutoHideAnimation animation) |
214 | -{ |
215 | - if (_autohide_animation == animation) |
216 | - return; |
217 | - |
218 | - _autohide_animation = animation; |
219 | -} |
220 | - |
221 | -void Launcher::SetFloating(bool floating) |
222 | -{ |
223 | - if (_floating == floating) |
224 | - return; |
225 | - |
226 | - _floating = floating; |
227 | - EnsureAnimation(); |
228 | -} |
229 | - |
230 | -void Launcher::SetBacklightMode(BacklightMode mode) |
231 | -{ |
232 | - if (_backlight_mode == mode) |
233 | - return; |
234 | - |
235 | - _backlight_mode = mode; |
236 | - EnsureAnimation(); |
237 | -} |
238 | - |
239 | BacklightMode Launcher::GetBacklightMode() const |
240 | { |
241 | - return _backlight_mode; |
242 | + return options()->backlight_mode(); |
243 | } |
244 | |
245 | bool Launcher::IsBackLightModeToggles() const |
246 | { |
247 | - switch (_backlight_mode) { |
248 | + switch (options()->backlight_mode()) { |
249 | case BACKLIGHT_NORMAL: |
250 | case BACKLIGHT_EDGE_TOGGLE: |
251 | case BACKLIGHT_NORMAL_EDGE_TOGGLE: |
252 | @@ -1640,36 +1607,6 @@ |
253 | } |
254 | |
255 | void |
256 | -Launcher::SetLaunchAnimation(LaunchAnimation animation) |
257 | -{ |
258 | - if (_launch_animation == animation) |
259 | - return; |
260 | - |
261 | - _launch_animation = animation; |
262 | -} |
263 | - |
264 | -LaunchAnimation |
265 | -Launcher::GetLaunchAnimation() const |
266 | -{ |
267 | - return _launch_animation; |
268 | -} |
269 | - |
270 | -void |
271 | -Launcher::SetUrgentAnimation(UrgentAnimation animation) |
272 | -{ |
273 | - if (_urgent_animation == animation) |
274 | - return; |
275 | - |
276 | - _urgent_animation = animation; |
277 | -} |
278 | - |
279 | -UrgentAnimation |
280 | -Launcher::GetUrgentAnimation() const |
281 | -{ |
282 | - return _urgent_animation; |
283 | -} |
284 | - |
285 | -void |
286 | Launcher::SetActionState(LauncherActionState actionstate) |
287 | { |
288 | if (_launcher_action_state == actionstate) |
289 | @@ -1812,15 +1749,6 @@ |
290 | |
291 | } |
292 | |
293 | -void Launcher::SetBackgroundAlpha(float background_alpha) |
294 | -{ |
295 | - if (_background_alpha == background_alpha) |
296 | - return; |
297 | - |
298 | - _background_alpha = background_alpha; |
299 | - NeedRedraw(); |
300 | -} |
301 | - |
302 | void Launcher::OnIconAdded(AbstractLauncherIcon* icon) |
303 | { |
304 | EnsureAnimation(); |
305 | @@ -2008,7 +1936,7 @@ |
306 | else |
307 | { |
308 | nux::Color color = _background_color; |
309 | - color.alpha = _background_alpha; |
310 | + color.alpha = options()->background_alpha; |
311 | gPainter.Paint2DQuadColor(GfxContext, bkg_box, color); |
312 | } |
313 | |
314 | @@ -2386,10 +2314,10 @@ |
315 | _hide_machine->AddRevealPressure(event->velocity); |
316 | decaymulator_->value = 0; |
317 | } |
318 | - else |
319 | + else if (abs_geo.x > 0) |
320 | { |
321 | decaymulator_->value = decaymulator_->value + event->velocity; |
322 | - if (decaymulator_->value > options()->edge_overcome_pressure) |
323 | + if (decaymulator_->value > _edge_overcome_pressure) |
324 | { |
325 | _pointer_barrier->ReleaseBarrier(event->event_id); |
326 | } |
327 | |
328 | === modified file 'plugins/unityshell/src/Launcher.h' |
329 | --- plugins/unityshell/src/Launcher.h 2012-01-29 05:07:56 +0000 |
330 | +++ plugins/unityshell/src/Launcher.h 2012-02-01 01:11:26 +0000 |
331 | @@ -78,7 +78,6 @@ |
332 | AbstractLauncherIcon* GetSelectedMenuIcon() const; |
333 | |
334 | void SetIconSize(int tile_size, int icon_size); |
335 | - void SetBackgroundAlpha(float background_alpha); |
336 | |
337 | LauncherHideMachine* HideMachine() { return _hide_machine; } |
338 | |
339 | @@ -93,11 +92,6 @@ |
340 | void SetModel(LauncherModel* model); |
341 | LauncherModel* GetModel() const; |
342 | |
343 | - void SetFloating(bool floating); |
344 | - |
345 | - void SetHideMode(LauncherHideMode hidemode); |
346 | - LauncherHideMode GetHideMode() const; |
347 | - |
348 | void StartKeyShowLauncher(); |
349 | void EndKeyShowLauncher(); |
350 | |
351 | @@ -107,15 +101,6 @@ |
352 | BacklightMode GetBacklightMode() const; |
353 | bool IsBackLightModeToggles() const; |
354 | |
355 | - void SetLaunchAnimation(LaunchAnimation animation); |
356 | - LaunchAnimation GetLaunchAnimation() const; |
357 | - |
358 | - void SetUrgentAnimation(UrgentAnimation animation); |
359 | - UrgentAnimation GetUrgentAnimation() const; |
360 | - |
361 | - void SetAutoHideAnimation(AutoHideAnimation animation); |
362 | - AutoHideAnimation GetAutoHideAnimation() const; |
363 | - |
364 | nux::BaseWindow* GetParent() const |
365 | { |
366 | return _parent; |
367 | @@ -166,6 +151,9 @@ |
368 | private: |
369 | typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr; |
370 | |
371 | + LauncherHideMode GetHideMode() const; |
372 | + void SetHideMode(LauncherHideMode hidemode); |
373 | + |
374 | typedef enum |
375 | { |
376 | ACTION_NONE, |
377 | @@ -343,7 +331,6 @@ |
378 | QuicklistView* _active_quicklist; |
379 | |
380 | bool _hovered; |
381 | - bool _floating; |
382 | bool _hidden; |
383 | bool _render_drag_window; |
384 | bool _check_window_over_launcher; |
385 | @@ -357,13 +344,13 @@ |
386 | float _folded_z_distance; |
387 | float _launcher_top_y; |
388 | float _launcher_bottom_y; |
389 | + float _edge_overcome_pressure; |
390 | |
391 | LauncherHideMode _hidemode; |
392 | |
393 | LauncherActionState _launcher_action_state; |
394 | LaunchAnimation _launch_animation; |
395 | UrgentAnimation _urgent_animation; |
396 | - AutoHideAnimation _autohide_animation; |
397 | |
398 | nux::ObjectPtr<nux::IOpenGLBaseTexture> _offscreen_drag_texture; |
399 | |
400 | |
401 | === modified file 'plugins/unityshell/src/LauncherController.cpp' |
402 | --- plugins/unityshell/src/LauncherController.cpp 2012-01-30 18:48:50 +0000 |
403 | +++ plugins/unityshell/src/LauncherController.cpp 2012-02-01 01:11:26 +0000 |
404 | @@ -763,19 +763,6 @@ |
405 | Controller::Controller(Display* display) |
406 | { |
407 | options = Options::Ptr(new Options()); |
408 | - |
409 | - // defaults must match XML file |
410 | - options()->tile_size = 54; |
411 | - options()->icon_size = 48; |
412 | - options()->backlight_mode = BACKLIGHT_ALWAYS_ON; |
413 | - options()->hide_mode = LAUNCHER_HIDE_DODGE_WINDOWS; |
414 | - options()->launch_animation = LAUNCH_ANIMATION_PULSE; |
415 | - options()->urgent_animation = URGENT_ANIMATION_WIGGLE; |
416 | - options()->edge_reveal_pressure = 2000; |
417 | - options()->edge_overcome_pressure = 2000; |
418 | - options()->edge_decay_rate = 1500; |
419 | - options()->edge_stop_velocity = 4500; |
420 | - |
421 | // options must be set before creating pimpl which loads launchers |
422 | pimpl = new Impl(display, this); |
423 | } |
424 | |
425 | === modified file 'plugins/unityshell/src/LauncherOptions.cpp' |
426 | --- plugins/unityshell/src/LauncherOptions.cpp 2012-01-26 03:41:09 +0000 |
427 | +++ plugins/unityshell/src/LauncherOptions.cpp 2012-02-01 01:11:26 +0000 |
428 | @@ -27,69 +27,34 @@ |
429 | |
430 | Options::Options() |
431 | { |
432 | - hide_mode.changed.connect(sigc::mem_fun (this, &Options::OnHideModeChanged)); |
433 | - launch_animation.changed.connect(sigc::mem_fun (this, &Options::OnLaunchAnimationChanged)); |
434 | - urgent_animation.changed.connect(sigc::mem_fun (this, &Options::OnUrgentAnimationChanged)); |
435 | - auto_hide_animation.changed.connect(sigc::mem_fun (this, &Options::OnAutoHideAnimationChanged)); |
436 | - backlight_mode.changed.connect(sigc::mem_fun (this, &Options::OnBacklightModeChanged)); |
437 | - icon_size.changed.connect(sigc::mem_fun (this, &Options::OnIconSizeChanged)); |
438 | - tile_size.changed.connect(sigc::mem_fun (this, &Options::OnTileSizeChanged)); |
439 | - floating.changed.connect(sigc::mem_fun (this, &Options::OnFloatingChanged)); |
440 | - background_alpha.changed.connect(sigc::mem_fun (this, &Options::OnBackgroundAlphaChanged)); |
441 | - edge_decay_rate.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged)); |
442 | - edge_overcome_pressure.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged)); |
443 | - edge_stop_velocity.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged)); |
444 | - edge_reveal_pressure.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged)); |
445 | -} |
446 | - |
447 | -void Options::OnEdgeOptionChanged(int value) |
448 | -{ |
449 | - option_changed.emit(); |
450 | -} |
451 | - |
452 | -void Options::OnHideModeChanged(LauncherHideMode value) |
453 | -{ |
454 | - option_changed.emit(); |
455 | -} |
456 | - |
457 | -void Options::OnLaunchAnimationChanged(LaunchAnimation value) |
458 | -{ |
459 | - option_changed.emit(); |
460 | -} |
461 | - |
462 | -void Options::OnUrgentAnimationChanged(UrgentAnimation value) |
463 | -{ |
464 | - option_changed.emit(); |
465 | -} |
466 | - |
467 | -void Options::OnAutoHideAnimationChanged(AutoHideAnimation value) |
468 | -{ |
469 | - option_changed.emit(); |
470 | -} |
471 | - |
472 | -void Options::OnBacklightModeChanged(BacklightMode value) |
473 | -{ |
474 | - option_changed.emit(); |
475 | -} |
476 | - |
477 | -void Options::OnIconSizeChanged(int value) |
478 | -{ |
479 | - option_changed.emit(); |
480 | -} |
481 | - |
482 | -void Options::OnTileSizeChanged(int value) |
483 | -{ |
484 | - option_changed.emit(); |
485 | -} |
486 | - |
487 | -void Options::OnFloatingChanged(bool value) |
488 | -{ |
489 | - option_changed.emit(); |
490 | -} |
491 | - |
492 | -void Options::OnBackgroundAlphaChanged(float value) |
493 | -{ |
494 | - option_changed.emit(); |
495 | + // defaults from XML file |
496 | + auto_hide_animation = FADE_AND_SLIDE; |
497 | + background_alpha = 0.6667; |
498 | + backlight_mode = BACKLIGHT_ALWAYS_ON; |
499 | + edge_decay_rate = 1500; |
500 | + edge_overcome_pressure = 2000; |
501 | + edge_responsiveness = 1.0f; |
502 | + edge_reveal_pressure = 2000; |
503 | + edge_stop_velocity = 4500; |
504 | + hide_mode = LAUNCHER_HIDE_DODGE_WINDOWS; |
505 | + icon_size = 48; |
506 | + launch_animation = LAUNCH_ANIMATION_PULSE; |
507 | + tile_size = 54; |
508 | + urgent_animation = URGENT_ANIMATION_WIGGLE; |
509 | + |
510 | + auto_hide_animation.changed.connect ([&] (AutoHideAnimation value)-> void { option_changed.emit(); }); |
511 | + background_alpha.changed.connect ([&] (float value) -> void { option_changed.emit(); }); |
512 | + backlight_mode.changed.connect ([&] (BacklightMode value) -> void { option_changed.emit(); }); |
513 | + edge_decay_rate.changed.connect ([&] (int value) -> void { option_changed.emit(); }); |
514 | + edge_overcome_pressure.changed.connect([&] (int value) -> void { option_changed.emit(); }); |
515 | + edge_responsiveness.changed.connect ([&] (float value) -> void { option_changed.emit(); }); |
516 | + edge_reveal_pressure.changed.connect ([&] (int value) -> void { option_changed.emit(); }); |
517 | + edge_stop_velocity.changed.connect ([&] (int value) -> void { option_changed.emit(); }); |
518 | + hide_mode.changed.connect ([&] (LauncherHideMode value) -> void { option_changed.emit(); }); |
519 | + icon_size.changed.connect ([&] (int value) -> void { option_changed.emit(); }); |
520 | + launch_animation.changed.connect ([&] (LaunchAnimation value) -> void { option_changed.emit(); }); |
521 | + tile_size.changed.connect ([&] (int value) -> void { option_changed.emit(); }); |
522 | + urgent_animation.changed.connect ([&] (UrgentAnimation value) -> void { option_changed.emit(); }); |
523 | } |
524 | |
525 | |
526 | |
527 | === modified file 'plugins/unityshell/src/LauncherOptions.h' |
528 | --- plugins/unityshell/src/LauncherOptions.h 2012-01-26 03:41:09 +0000 |
529 | +++ plugins/unityshell/src/LauncherOptions.h 2012-02-01 01:11:26 +0000 |
530 | @@ -86,26 +86,14 @@ |
531 | nux::Property<BacklightMode> backlight_mode; |
532 | nux::Property<int> icon_size; |
533 | nux::Property<int> tile_size; |
534 | - nux::Property<bool> floating; |
535 | nux::Property<float> background_alpha; |
536 | nux::Property<int> edge_decay_rate; |
537 | nux::Property<int> edge_overcome_pressure; |
538 | nux::Property<int> edge_stop_velocity; |
539 | nux::Property<int> edge_reveal_pressure; |
540 | + nux::Property<float> edge_responsiveness; |
541 | |
542 | sigc::signal<void> option_changed; |
543 | - |
544 | -private: |
545 | - void OnHideModeChanged(LauncherHideMode value); |
546 | - void OnLaunchAnimationChanged(LaunchAnimation value); |
547 | - void OnUrgentAnimationChanged(UrgentAnimation value); |
548 | - void OnAutoHideAnimationChanged(AutoHideAnimation value); |
549 | - void OnBacklightModeChanged(BacklightMode value); |
550 | - void OnIconSizeChanged(int value); |
551 | - void OnEdgeOptionChanged(int value); |
552 | - void OnTileSizeChanged(int value); |
553 | - void OnFloatingChanged(bool value); |
554 | - void OnBackgroundAlphaChanged(float value); |
555 | }; |
556 | |
557 | } |
558 | |
559 | === modified file 'plugins/unityshell/src/PointerBarrier.cpp' |
560 | --- plugins/unityshell/src/PointerBarrier.cpp 2012-01-30 18:38:12 +0000 |
561 | +++ plugins/unityshell/src/PointerBarrier.cpp 2012-02-01 01:11:26 +0000 |
562 | @@ -44,6 +44,8 @@ |
563 | smoothing = 75; |
564 | smoothing_count_ = 0; |
565 | smoothing_accum_ = 0; |
566 | + smoothing_handle_ = 0; |
567 | + max_velocity_multiplier = 1.0f; |
568 | } |
569 | |
570 | void PointerBarrierWrapper::ConstructBarrier() |
571 | @@ -108,7 +110,7 @@ |
572 | BarrierEvent::Ptr event (new BarrierEvent()); |
573 | event->x = last_x_; |
574 | event->y = last_y_; |
575 | - event->velocity = std::min<int> (600, smoothing_accum_ / smoothing_count_); |
576 | + event->velocity = std::min<int> (600 * max_velocity_multiplier, smoothing_accum_ / smoothing_count_); |
577 | event->event_id = last_event_; |
578 | |
579 | barrier_event.emit(this, event); |
580 | @@ -125,16 +127,6 @@ |
581 | |
582 | if (notify_event->barrier == barrier && notify_event->subtype == XFixesBarrierHitNotify) |
583 | { |
584 | - if (notify_event->event_id != last_event_) |
585 | - { |
586 | - EmitCurrentData(); |
587 | - if (smoothing_handle_) |
588 | - { |
589 | - g_source_remove(smoothing_handle_); |
590 | - smoothing_handle_ = 0; |
591 | - } |
592 | - } |
593 | - |
594 | last_x_ = notify_event->x; |
595 | last_y_ = notify_event->y; |
596 | last_event_ = notify_event->event_id; |
597 | |
598 | === modified file 'plugins/unityshell/src/PointerBarrier.h' |
599 | --- plugins/unityshell/src/PointerBarrier.h 2012-01-27 03:28:20 +0000 |
600 | +++ plugins/unityshell/src/PointerBarrier.h 2012-02-01 01:11:26 +0000 |
601 | @@ -57,6 +57,8 @@ |
602 | |
603 | nux::Property<int> smoothing; |
604 | |
605 | + nux::Property<float> max_velocity_multiplier; |
606 | + |
607 | PointerBarrierWrapper(); |
608 | |
609 | void ConstructBarrier(); |
610 | |
611 | === modified file 'plugins/unityshell/src/unityshell.cpp' |
612 | --- plugins/unityshell/src/unityshell.cpp 2012-01-29 22:41:55 +0000 |
613 | +++ plugins/unityshell/src/unityshell.cpp 2012-02-01 01:11:26 +0000 |
614 | @@ -309,6 +309,7 @@ |
615 | |
616 | optionSetStopVelocityNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); |
617 | optionSetRevealPressureNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); |
618 | + optionSetEdgeResponsivenessNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); |
619 | optionSetOvercomePressureNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); |
620 | optionSetDecayRateNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); |
621 | optionSetShowMinimizedWindowsNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2)); |
622 | @@ -2165,7 +2166,7 @@ |
623 | { |
624 | nux::Geometry geo = launcher->GetAbsoluteGeometry(); |
625 | |
626 | - if (launcher->Hidden() || launcher->GetHideMode() == LAUNCHER_HIDE_NEVER || launcher->GetHideMode() == LAUNCHER_HIDE_AUTOHIDE) |
627 | + if (launcher->Hidden() || launcher->options()->hide_mode == LAUNCHER_HIDE_NEVER || launcher->options()->hide_mode == LAUNCHER_HIDE_AUTOHIDE) |
628 | continue; |
629 | |
630 | if (geo.IsInside(result)) |
631 | @@ -2368,6 +2369,8 @@ |
632 | break; |
633 | case UnityshellOptions::RevealPressure: |
634 | launcher_options->edge_reveal_pressure = optionGetRevealPressure() * 100; |
635 | + case UnityshellOptions::EdgeResponsiveness: |
636 | + launcher_options->edge_responsiveness = optionGetEdgeResponsiveness(); |
637 | break; |
638 | default: |
639 | break; |
640 | |
641 | === modified file 'plugins/unityshell/unityshell.xml.in' |
642 | --- plugins/unityshell/unityshell.xml.in 2012-01-30 18:40:04 +0000 |
643 | +++ plugins/unityshell/unityshell.xml.in 2012-02-01 01:11:26 +0000 |
644 | @@ -268,6 +268,14 @@ |
645 | <max>64</max> |
646 | <precision>1</precision> |
647 | </option> |
648 | + <option name="edge_responsiveness" type="float"> |
649 | + <_short>Launcher Reveal Edge Responsiveness</_short> |
650 | + <_long>A conglomerate setting that modifies the overall responsiveness of the launcher reveal</_long> |
651 | + <default>1.0</default> |
652 | + <min>0.2</min> |
653 | + <max>8.0</max> |
654 | + <precision>0.1</precision> |
655 | + </option> |
656 | <option name="reveal_pressure" type="int"> |
657 | <_short>Launcher Reveal Pressure</_short> |
658 | <_long>Amount of mouse pressure required to reveal launcher</_long> |
+1