Merge lp:~unity-team/unity/unity.dont-emit-on-id-change into lp:unity

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
Reviewer Review Type Date Requested Status
Robert Carr (community) Approve
Gord Allott (community) Approve
Review via email: mp+90923@code.launchpad.net

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
Revision history for this message
Robert Carr (robertcarr) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/unityshell/src/Launcher.cpp'
--- plugins/unityshell/src/Launcher.cpp 2012-01-31 11:26:07 +0000
+++ plugins/unityshell/src/Launcher.cpp 2012-02-01 01:11:26 +0000
@@ -199,9 +199,6 @@
199 _launcher_bottom_y = 0;199 _launcher_bottom_y = 0;
200 _folded_z_distance = 10.0f;200 _folded_z_distance = 10.0f;
201 _launcher_action_state = ACTION_NONE;201 _launcher_action_state = ACTION_NONE;
202 _launch_animation = LAUNCH_ANIMATION_NONE;
203 _urgent_animation = URGENT_ANIMATION_NONE;
204 _autohide_animation = FADE_AND_SLIDE;
205 _hidemode = LAUNCHER_HIDE_NEVER;202 _hidemode = LAUNCHER_HIDE_NEVER;
206 _icon_under_mouse = NULL;203 _icon_under_mouse = NULL;
207 _icon_mouse_down = NULL;204 _icon_mouse_down = NULL;
@@ -210,7 +207,6 @@
210 _icon_glow_size = 62;207 _icon_glow_size = 62;
211 _icon_image_size_delta = 6;208 _icon_image_size_delta = 6;
212 _icon_size = _icon_image_size + _icon_image_size_delta;209 _icon_size = _icon_image_size + _icon_image_size_delta;
213 _background_alpha = 0.6667; // about 0xAA
214210
215 _enter_y = 0;211 _enter_y = 0;
216 _launcher_drag_delta = 0;212 _launcher_drag_delta = 0;
@@ -222,16 +218,15 @@
222 _dnd_check_handle = 0;218 _dnd_check_handle = 0;
223219
224 _shortcuts_shown = false;220 _shortcuts_shown = false;
225 _floating = false;
226 _hovered = false;221 _hovered = false;
227 _hidden = false;222 _hidden = false;
228 _render_drag_window = false;223 _render_drag_window = false;
229 _drag_edge_touching = false;224 _drag_edge_touching = false;
230 _backlight_mode = BACKLIGHT_NORMAL;
231 _last_button_press = 0;225 _last_button_press = 0;
232 _selection_atom = 0;226 _selection_atom = 0;
233 _drag_out_id = 0;227 _drag_out_id = 0;
234 _drag_out_delta_x = 0.0f;228 _drag_out_delta_x = 0.0f;
229 _edge_overcome_pressure = 0.0f;
235230
236 // FIXME: remove231 // FIXME: remove
237 _initial_drag_animation = false;232 _initial_drag_animation = false;
@@ -404,7 +399,6 @@
404 .add("dnd-exit-progress", DnDExitProgress(current))399 .add("dnd-exit-progress", DnDExitProgress(current))
405 .add("autohide-progress", AutohideProgress(current))400 .add("autohide-progress", AutohideProgress(current))
406 .add("dnd-delta", _dnd_delta_y)401 .add("dnd-delta", _dnd_delta_y)
407 .add("floating", _floating)
408 .add("hovered", _hovered)402 .add("hovered", _hovered)
409 .add("hidemode", _hidemode)403 .add("hidemode", _hidemode)
410 .add("hidden", _hidden)404 .add("hidden", _hidden)
@@ -609,7 +603,7 @@
609/* Min is when you are on the trigger */603/* Min is when you are on the trigger */
610float Launcher::GetAutohidePositionMin() const604float Launcher::GetAutohidePositionMin() const
611{605{
612 if (_autohide_animation == SLIDE_ONLY || _autohide_animation == FADE_AND_SLIDE)606 if (options()->auto_hide_animation() == SLIDE_ONLY || options()->auto_hide_animation() == FADE_AND_SLIDE)
613 return 0.35f;607 return 0.35f;
614 else608 else
615 return 0.25f;609 return 0.25f;
@@ -617,7 +611,7 @@
617/* Max is the initial state over the bfb */611/* Max is the initial state over the bfb */
618float Launcher::GetAutohidePositionMax() const612float Launcher::GetAutohidePositionMax() const
619{613{
620 if (_autohide_animation == SLIDE_ONLY || _autohide_animation == FADE_AND_SLIDE)614 if (options()->auto_hide_animation() == SLIDE_ONLY || options()->auto_hide_animation() == FADE_AND_SLIDE)
621 return 1.00f;615 return 1.00f;
622 else616 else
623 return 0.75f;617 return 0.75f;
@@ -684,7 +678,7 @@
684 int urgent_ms = unity::TimeUtil::TimeDelta(&current, &urgent_time);678 int urgent_ms = unity::TimeUtil::TimeDelta(&current, &urgent_time);
685 float result;679 float result;
686680
687 if (_urgent_animation == URGENT_ANIMATION_WIGGLE)681 if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
688 result = CLAMP((float) urgent_ms / (float)(ANIM_DURATION_SHORT * WIGGLE_CYCLES), 0.0f, 1.0f);682 result = CLAMP((float) urgent_ms / (float)(ANIM_DURATION_SHORT * WIGGLE_CYCLES), 0.0f, 1.0f);
689 else683 else
690 result = CLAMP((float) urgent_ms / (float)(ANIM_DURATION_LONG * URGENT_BLINKS * 2), 0.0f, 1.0f);684 result = CLAMP((float) urgent_ms / (float)(ANIM_DURATION_LONG * URGENT_BLINKS * 2), 0.0f, 1.0f);
@@ -803,22 +797,22 @@
803 icon->SetQuirk(AbstractLauncherIcon::QUIRK_STARTING, false);797 icon->SetQuirk(AbstractLauncherIcon::QUIRK_STARTING, false);
804798
805 float backlight_strength;799 float backlight_strength;
806 if (_backlight_mode == BACKLIGHT_ALWAYS_ON)800 if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON)
807 backlight_strength = BACKLIGHT_STRENGTH;801 backlight_strength = BACKLIGHT_STRENGTH;
808 else if (IsBackLightModeToggles())802 else if (IsBackLightModeToggles())
809 backlight_strength = BACKLIGHT_STRENGTH * running_progress;803 backlight_strength = BACKLIGHT_STRENGTH * running_progress;
810 else804 else
811 backlight_strength = 0.0f;805 backlight_strength = 0.0f;
812806
813 switch (_launch_animation)807 switch (options()->launch_animation())
814 {808 {
815 case LAUNCH_ANIMATION_NONE:809 case LAUNCH_ANIMATION_NONE:
816 result = backlight_strength;810 result = backlight_strength;
817 break;811 break;
818 case LAUNCH_ANIMATION_BLINK:812 case LAUNCH_ANIMATION_BLINK:
819 if (_backlight_mode == BACKLIGHT_ALWAYS_ON)813 if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON)
820 result = IconStartingBlinkValue(icon, current);814 result = IconStartingBlinkValue(icon, current);
821 else if (_backlight_mode == BACKLIGHT_ALWAYS_OFF)815 else if (options()->backlight_mode() == BACKLIGHT_ALWAYS_OFF)
822 result = 1.0f - IconStartingBlinkValue(icon, current);816 result = 1.0f - IconStartingBlinkValue(icon, current);
823 else817 else
824 result = backlight_strength; // The blink concept is a failure in this case (it just doesn't work right)818 result = backlight_strength; // The blink concept is a failure in this case (it just doesn't work right)
@@ -828,7 +822,7 @@
828 icon->ResetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);822 icon->ResetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
829823
830 result = backlight_strength;824 result = backlight_strength;
831 if (_backlight_mode == BACKLIGHT_ALWAYS_ON)825 if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON)
832 result *= CLAMP(running_progress + IconStartingPulseValue(icon, current), 0.0f, 1.0f);826 result *= CLAMP(running_progress + IconStartingPulseValue(icon, current), 0.0f, 1.0f);
833 else if (IsBackLightModeToggles())827 else if (IsBackLightModeToggles())
834 result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconStartingPulseValue(icon, current));828 result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconStartingPulseValue(icon, current));
@@ -839,16 +833,16 @@
839833
840 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PULSE_ONCE))834 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PULSE_ONCE))
841 {835 {
842 if (_backlight_mode == BACKLIGHT_ALWAYS_ON)836 if (options()->backlight_mode() == BACKLIGHT_ALWAYS_ON)
843 result *= CLAMP(running_progress + IconPulseOnceValue(icon, current), 0.0f, 1.0f);837 result *= CLAMP(running_progress + IconPulseOnceValue(icon, current), 0.0f, 1.0f);
844 else if (_backlight_mode == BACKLIGHT_NORMAL)838 else if (options()->backlight_mode() == BACKLIGHT_NORMAL)
845 result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconPulseOnceValue(icon, current));839 result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconPulseOnceValue(icon, current));
846 else840 else
847 result = 1.0f - CLAMP(running_progress + IconPulseOnceValue(icon, current), 0.0f, 1.0f);841 result = 1.0f - CLAMP(running_progress + IconPulseOnceValue(icon, current), 0.0f, 1.0f);
848 }842 }
849843
850 // urgent serves to bring the total down only844 // urgent serves to bring the total down only
851 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && _urgent_animation == URGENT_ANIMATION_PULSE)845 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && options()->urgent_animation() == URGENT_ANIMATION_PULSE)
852 result *= 0.2f + 0.8f * IconUrgentPulseValue(icon, current);846 result *= 0.2f + 0.8f * IconUrgentPulseValue(icon, current);
853847
854 return result;848 return result;
@@ -868,10 +862,10 @@
868862
869bool Launcher::IconDrawEdgeOnly(AbstractLauncherIcon* icon) const863bool Launcher::IconDrawEdgeOnly(AbstractLauncherIcon* icon) const
870{864{
871 if (_backlight_mode == BACKLIGHT_EDGE_TOGGLE)865 if (options()->backlight_mode() == BACKLIGHT_EDGE_TOGGLE)
872 return true;866 return true;
873867
874 if (_backlight_mode == BACKLIGHT_NORMAL_EDGE_TOGGLE && !icon->WindowVisibleOnMonitor(monitor))868 if (options()->backlight_mode() == BACKLIGHT_NORMAL_EDGE_TOGGLE && !icon->WindowVisibleOnMonitor(monitor))
875 return true;869 return true;
876870
877 return false;871 return false;
@@ -938,7 +932,7 @@
938 urgent_progress = CLAMP(urgent_progress * 3.0f - 2.0f, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle932 urgent_progress = CLAMP(urgent_progress * 3.0f - 2.0f, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle
939 arg.glow_intensity = urgent_progress;933 arg.glow_intensity = urgent_progress;
940934
941 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && _urgent_animation == URGENT_ANIMATION_WIGGLE)935 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_URGENT) && options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
942 {936 {
943 arg.z_rotation = IconUrgentWiggleValue(icon, current);937 arg.z_rotation = IconUrgentWiggleValue(icon, current);
944 }938 }
@@ -1101,7 +1095,7 @@
1101 {1095 {
11021096
1103 float autohide_progress = AutohideProgress(current) * (1.0f - DragOutProgress(current));1097 float autohide_progress = AutohideProgress(current) * (1.0f - DragOutProgress(current));
1104 if (_autohide_animation == FADE_ONLY)1098 if (options()->auto_hide_animation() == FADE_ONLY)
1105 {1099 {
1106 *launcher_alpha = 1.0f - autohide_progress;1100 *launcher_alpha = 1.0f - autohide_progress;
1107 }1101 }
@@ -1110,7 +1104,7 @@
1110 if (autohide_progress > 0.0f)1104 if (autohide_progress > 0.0f)
1111 {1105 {
1112 autohide_offset -= geo.width * autohide_progress;1106 autohide_offset -= geo.width * autohide_progress;
1113 if (_autohide_animation == FADE_AND_SLIDE)1107 if (options()->auto_hide_animation() == FADE_AND_SLIDE)
1114 *launcher_alpha = 1.0f - 0.5f * autohide_progress;1108 *launcher_alpha = 1.0f - 0.5f * autohide_progress;
1115 }1109 }
1116 }1110 }
@@ -1554,20 +1548,24 @@
1554Launcher::UpdateOptions(Options::Ptr options)1548Launcher::UpdateOptions(Options::Ptr options)
1555{1549{
1556 SetHideMode(options->hide_mode);1550 SetHideMode(options->hide_mode);
1557 SetAutoHideAnimation(options->auto_hide_animation);
1558 SetFloating(options->floating);
1559 SetBacklightMode(options->backlight_mode);
1560 SetLaunchAnimation(options->launch_animation);
1561 SetUrgentAnimation(options->urgent_animation);
1562 SetIconSize(options->tile_size, options->icon_size);1551 SetIconSize(options->tile_size, options->icon_size);
1563 decaymulator_->rate_of_decay = options->edge_decay_rate();1552
1553 // make the effect half as strong as specified as other values shouldn't scale
1554 // as quickly as the max velocity multiplier
1555 float responsiveness_mult = ((options->edge_responsiveness() - 1) * .025) + 1;
1556
1557 decaymulator_->rate_of_decay = options->edge_decay_rate() * responsiveness_mult;
1558 _edge_overcome_pressure = options->edge_overcome_pressure() * responsiveness_mult;
15641559
1565 _pointer_barrier->threshold = options->edge_stop_velocity();1560 _pointer_barrier->threshold = options->edge_stop_velocity();
1561 _pointer_barrier->max_velocity_multiplier = options->edge_responsiveness();
1566 _pointer_barrier->DestroyBarrier();1562 _pointer_barrier->DestroyBarrier();
1567 _pointer_barrier->ConstructBarrier();1563 _pointer_barrier->ConstructBarrier();
15681564
1569 _hide_machine->reveal_pressure = options->edge_reveal_pressure();1565 _hide_machine->reveal_pressure = options->edge_reveal_pressure() * responsiveness_mult;
1570 _hide_machine->edge_decay_rate = options->edge_decay_rate();1566 _hide_machine->edge_decay_rate = options->edge_decay_rate() * responsiveness_mult;
1567
1568 EnsureAnimation();
1571}1569}
15721570
1573void Launcher::SetHideMode(LauncherHideMode hidemode)1571void Launcher::SetHideMode(LauncherHideMode hidemode)
@@ -1591,45 +1589,14 @@
1591 EnsureAnimation();1589 EnsureAnimation();
1592}1590}
15931591
1594AutoHideAnimation Launcher::GetAutoHideAnimation() const
1595{
1596 return _autohide_animation;
1597}
1598
1599void Launcher::SetAutoHideAnimation(AutoHideAnimation animation)
1600{
1601 if (_autohide_animation == animation)
1602 return;
1603
1604 _autohide_animation = animation;
1605}
1606
1607void Launcher::SetFloating(bool floating)
1608{
1609 if (_floating == floating)
1610 return;
1611
1612 _floating = floating;
1613 EnsureAnimation();
1614}
1615
1616void Launcher::SetBacklightMode(BacklightMode mode)
1617{
1618 if (_backlight_mode == mode)
1619 return;
1620
1621 _backlight_mode = mode;
1622 EnsureAnimation();
1623}
1624
1625BacklightMode Launcher::GetBacklightMode() const1592BacklightMode Launcher::GetBacklightMode() const
1626{1593{
1627 return _backlight_mode;1594 return options()->backlight_mode();
1628}1595}
16291596
1630bool Launcher::IsBackLightModeToggles() const1597bool Launcher::IsBackLightModeToggles() const
1631{1598{
1632 switch (_backlight_mode) {1599 switch (options()->backlight_mode()) {
1633 case BACKLIGHT_NORMAL:1600 case BACKLIGHT_NORMAL:
1634 case BACKLIGHT_EDGE_TOGGLE:1601 case BACKLIGHT_EDGE_TOGGLE:
1635 case BACKLIGHT_NORMAL_EDGE_TOGGLE:1602 case BACKLIGHT_NORMAL_EDGE_TOGGLE:
@@ -1640,36 +1607,6 @@
1640}1607}
16411608
1642void1609void
1643Launcher::SetLaunchAnimation(LaunchAnimation animation)
1644{
1645 if (_launch_animation == animation)
1646 return;
1647
1648 _launch_animation = animation;
1649}
1650
1651LaunchAnimation
1652Launcher::GetLaunchAnimation() const
1653{
1654 return _launch_animation;
1655}
1656
1657void
1658Launcher::SetUrgentAnimation(UrgentAnimation animation)
1659{
1660 if (_urgent_animation == animation)
1661 return;
1662
1663 _urgent_animation = animation;
1664}
1665
1666UrgentAnimation
1667Launcher::GetUrgentAnimation() const
1668{
1669 return _urgent_animation;
1670}
1671
1672void
1673Launcher::SetActionState(LauncherActionState actionstate)1610Launcher::SetActionState(LauncherActionState actionstate)
1674{1611{
1675 if (_launcher_action_state == actionstate)1612 if (_launcher_action_state == actionstate)
@@ -1812,15 +1749,6 @@
18121749
1813}1750}
18141751
1815void Launcher::SetBackgroundAlpha(float background_alpha)
1816{
1817 if (_background_alpha == background_alpha)
1818 return;
1819
1820 _background_alpha = background_alpha;
1821 NeedRedraw();
1822}
1823
1824void Launcher::OnIconAdded(AbstractLauncherIcon* icon)1752void Launcher::OnIconAdded(AbstractLauncherIcon* icon)
1825{1753{
1826 EnsureAnimation();1754 EnsureAnimation();
@@ -2008,7 +1936,7 @@
2008 else1936 else
2009 {1937 {
2010 nux::Color color = _background_color;1938 nux::Color color = _background_color;
2011 color.alpha = _background_alpha;1939 color.alpha = options()->background_alpha;
2012 gPainter.Paint2DQuadColor(GfxContext, bkg_box, color);1940 gPainter.Paint2DQuadColor(GfxContext, bkg_box, color);
2013 }1941 }
20141942
@@ -2386,10 +2314,10 @@
2386 _hide_machine->AddRevealPressure(event->velocity);2314 _hide_machine->AddRevealPressure(event->velocity);
2387 decaymulator_->value = 0;2315 decaymulator_->value = 0;
2388 }2316 }
2389 else2317 else if (abs_geo.x > 0)
2390 {2318 {
2391 decaymulator_->value = decaymulator_->value + event->velocity;2319 decaymulator_->value = decaymulator_->value + event->velocity;
2392 if (decaymulator_->value > options()->edge_overcome_pressure)2320 if (decaymulator_->value > _edge_overcome_pressure)
2393 {2321 {
2394 _pointer_barrier->ReleaseBarrier(event->event_id);2322 _pointer_barrier->ReleaseBarrier(event->event_id);
2395 }2323 }
23962324
=== modified file 'plugins/unityshell/src/Launcher.h'
--- plugins/unityshell/src/Launcher.h 2012-01-29 05:07:56 +0000
+++ plugins/unityshell/src/Launcher.h 2012-02-01 01:11:26 +0000
@@ -78,7 +78,6 @@
78 AbstractLauncherIcon* GetSelectedMenuIcon() const;78 AbstractLauncherIcon* GetSelectedMenuIcon() const;
7979
80 void SetIconSize(int tile_size, int icon_size);80 void SetIconSize(int tile_size, int icon_size);
81 void SetBackgroundAlpha(float background_alpha);
8281
83 LauncherHideMachine* HideMachine() { return _hide_machine; }82 LauncherHideMachine* HideMachine() { return _hide_machine; }
8483
@@ -93,11 +92,6 @@
93 void SetModel(LauncherModel* model);92 void SetModel(LauncherModel* model);
94 LauncherModel* GetModel() const;93 LauncherModel* GetModel() const;
9594
96 void SetFloating(bool floating);
97
98 void SetHideMode(LauncherHideMode hidemode);
99 LauncherHideMode GetHideMode() const;
100
101 void StartKeyShowLauncher();95 void StartKeyShowLauncher();
102 void EndKeyShowLauncher();96 void EndKeyShowLauncher();
10397
@@ -107,15 +101,6 @@
107 BacklightMode GetBacklightMode() const;101 BacklightMode GetBacklightMode() const;
108 bool IsBackLightModeToggles() const;102 bool IsBackLightModeToggles() const;
109103
110 void SetLaunchAnimation(LaunchAnimation animation);
111 LaunchAnimation GetLaunchAnimation() const;
112
113 void SetUrgentAnimation(UrgentAnimation animation);
114 UrgentAnimation GetUrgentAnimation() const;
115
116 void SetAutoHideAnimation(AutoHideAnimation animation);
117 AutoHideAnimation GetAutoHideAnimation() const;
118
119 nux::BaseWindow* GetParent() const104 nux::BaseWindow* GetParent() const
120 {105 {
121 return _parent;106 return _parent;
@@ -166,6 +151,9 @@
166private:151private:
167 typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr;152 typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr;
168153
154 LauncherHideMode GetHideMode() const;
155 void SetHideMode(LauncherHideMode hidemode);
156
169 typedef enum157 typedef enum
170 {158 {
171 ACTION_NONE,159 ACTION_NONE,
@@ -343,7 +331,6 @@
343 QuicklistView* _active_quicklist;331 QuicklistView* _active_quicklist;
344332
345 bool _hovered;333 bool _hovered;
346 bool _floating;
347 bool _hidden;334 bool _hidden;
348 bool _render_drag_window;335 bool _render_drag_window;
349 bool _check_window_over_launcher;336 bool _check_window_over_launcher;
@@ -357,13 +344,13 @@
357 float _folded_z_distance;344 float _folded_z_distance;
358 float _launcher_top_y;345 float _launcher_top_y;
359 float _launcher_bottom_y;346 float _launcher_bottom_y;
347 float _edge_overcome_pressure;
360348
361 LauncherHideMode _hidemode;349 LauncherHideMode _hidemode;
362350
363 LauncherActionState _launcher_action_state;351 LauncherActionState _launcher_action_state;
364 LaunchAnimation _launch_animation;352 LaunchAnimation _launch_animation;
365 UrgentAnimation _urgent_animation;353 UrgentAnimation _urgent_animation;
366 AutoHideAnimation _autohide_animation;
367354
368 nux::ObjectPtr<nux::IOpenGLBaseTexture> _offscreen_drag_texture;355 nux::ObjectPtr<nux::IOpenGLBaseTexture> _offscreen_drag_texture;
369356
370357
=== modified file 'plugins/unityshell/src/LauncherController.cpp'
--- plugins/unityshell/src/LauncherController.cpp 2012-01-30 18:48:50 +0000
+++ plugins/unityshell/src/LauncherController.cpp 2012-02-01 01:11:26 +0000
@@ -763,19 +763,6 @@
763Controller::Controller(Display* display)763Controller::Controller(Display* display)
764{764{
765 options = Options::Ptr(new Options());765 options = Options::Ptr(new Options());
766
767 // defaults must match XML file
768 options()->tile_size = 54;
769 options()->icon_size = 48;
770 options()->backlight_mode = BACKLIGHT_ALWAYS_ON;
771 options()->hide_mode = LAUNCHER_HIDE_DODGE_WINDOWS;
772 options()->launch_animation = LAUNCH_ANIMATION_PULSE;
773 options()->urgent_animation = URGENT_ANIMATION_WIGGLE;
774 options()->edge_reveal_pressure = 2000;
775 options()->edge_overcome_pressure = 2000;
776 options()->edge_decay_rate = 1500;
777 options()->edge_stop_velocity = 4500;
778
779 // options must be set before creating pimpl which loads launchers766 // options must be set before creating pimpl which loads launchers
780 pimpl = new Impl(display, this);767 pimpl = new Impl(display, this);
781}768}
782769
=== modified file 'plugins/unityshell/src/LauncherOptions.cpp'
--- plugins/unityshell/src/LauncherOptions.cpp 2012-01-26 03:41:09 +0000
+++ plugins/unityshell/src/LauncherOptions.cpp 2012-02-01 01:11:26 +0000
@@ -27,69 +27,34 @@
2727
28Options::Options()28Options::Options()
29{29{
30 hide_mode.changed.connect(sigc::mem_fun (this, &Options::OnHideModeChanged));30 // defaults from XML file
31 launch_animation.changed.connect(sigc::mem_fun (this, &Options::OnLaunchAnimationChanged));31 auto_hide_animation = FADE_AND_SLIDE;
32 urgent_animation.changed.connect(sigc::mem_fun (this, &Options::OnUrgentAnimationChanged));32 background_alpha = 0.6667;
33 auto_hide_animation.changed.connect(sigc::mem_fun (this, &Options::OnAutoHideAnimationChanged));33 backlight_mode = BACKLIGHT_ALWAYS_ON;
34 backlight_mode.changed.connect(sigc::mem_fun (this, &Options::OnBacklightModeChanged));34 edge_decay_rate = 1500;
35 icon_size.changed.connect(sigc::mem_fun (this, &Options::OnIconSizeChanged));35 edge_overcome_pressure = 2000;
36 tile_size.changed.connect(sigc::mem_fun (this, &Options::OnTileSizeChanged));36 edge_responsiveness = 1.0f;
37 floating.changed.connect(sigc::mem_fun (this, &Options::OnFloatingChanged));37 edge_reveal_pressure = 2000;
38 background_alpha.changed.connect(sigc::mem_fun (this, &Options::OnBackgroundAlphaChanged));38 edge_stop_velocity = 4500;
39 edge_decay_rate.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged));39 hide_mode = LAUNCHER_HIDE_DODGE_WINDOWS;
40 edge_overcome_pressure.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged));40 icon_size = 48;
41 edge_stop_velocity.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged));41 launch_animation = LAUNCH_ANIMATION_PULSE;
42 edge_reveal_pressure.changed.connect(sigc::mem_fun (this, &Options::OnEdgeOptionChanged));42 tile_size = 54;
43}43 urgent_animation = URGENT_ANIMATION_WIGGLE;
4444
45void Options::OnEdgeOptionChanged(int value)45 auto_hide_animation.changed.connect ([&] (AutoHideAnimation value)-> void { option_changed.emit(); });
46{46 background_alpha.changed.connect ([&] (float value) -> void { option_changed.emit(); });
47 option_changed.emit();47 backlight_mode.changed.connect ([&] (BacklightMode value) -> void { option_changed.emit(); });
48}48 edge_decay_rate.changed.connect ([&] (int value) -> void { option_changed.emit(); });
4949 edge_overcome_pressure.changed.connect([&] (int value) -> void { option_changed.emit(); });
50void Options::OnHideModeChanged(LauncherHideMode value)50 edge_responsiveness.changed.connect ([&] (float value) -> void { option_changed.emit(); });
51{51 edge_reveal_pressure.changed.connect ([&] (int value) -> void { option_changed.emit(); });
52 option_changed.emit();52 edge_stop_velocity.changed.connect ([&] (int value) -> void { option_changed.emit(); });
53}53 hide_mode.changed.connect ([&] (LauncherHideMode value) -> void { option_changed.emit(); });
5454 icon_size.changed.connect ([&] (int value) -> void { option_changed.emit(); });
55void Options::OnLaunchAnimationChanged(LaunchAnimation value)55 launch_animation.changed.connect ([&] (LaunchAnimation value) -> void { option_changed.emit(); });
56{56 tile_size.changed.connect ([&] (int value) -> void { option_changed.emit(); });
57 option_changed.emit();57 urgent_animation.changed.connect ([&] (UrgentAnimation value) -> void { option_changed.emit(); });
58}
59
60void Options::OnUrgentAnimationChanged(UrgentAnimation value)
61{
62 option_changed.emit();
63}
64
65void Options::OnAutoHideAnimationChanged(AutoHideAnimation value)
66{
67 option_changed.emit();
68}
69
70void Options::OnBacklightModeChanged(BacklightMode value)
71{
72 option_changed.emit();
73}
74
75void Options::OnIconSizeChanged(int value)
76{
77 option_changed.emit();
78}
79
80void Options::OnTileSizeChanged(int value)
81{
82 option_changed.emit();
83}
84
85void Options::OnFloatingChanged(bool value)
86{
87 option_changed.emit();
88}
89
90void Options::OnBackgroundAlphaChanged(float value)
91{
92 option_changed.emit();
93}58}
9459
9560
9661
=== modified file 'plugins/unityshell/src/LauncherOptions.h'
--- plugins/unityshell/src/LauncherOptions.h 2012-01-26 03:41:09 +0000
+++ plugins/unityshell/src/LauncherOptions.h 2012-02-01 01:11:26 +0000
@@ -86,26 +86,14 @@
86 nux::Property<BacklightMode> backlight_mode;86 nux::Property<BacklightMode> backlight_mode;
87 nux::Property<int> icon_size;87 nux::Property<int> icon_size;
88 nux::Property<int> tile_size;88 nux::Property<int> tile_size;
89 nux::Property<bool> floating;
90 nux::Property<float> background_alpha;89 nux::Property<float> background_alpha;
91 nux::Property<int> edge_decay_rate;90 nux::Property<int> edge_decay_rate;
92 nux::Property<int> edge_overcome_pressure;91 nux::Property<int> edge_overcome_pressure;
93 nux::Property<int> edge_stop_velocity;92 nux::Property<int> edge_stop_velocity;
94 nux::Property<int> edge_reveal_pressure;93 nux::Property<int> edge_reveal_pressure;
94 nux::Property<float> edge_responsiveness;
9595
96 sigc::signal<void> option_changed;96 sigc::signal<void> option_changed;
97
98private:
99 void OnHideModeChanged(LauncherHideMode value);
100 void OnLaunchAnimationChanged(LaunchAnimation value);
101 void OnUrgentAnimationChanged(UrgentAnimation value);
102 void OnAutoHideAnimationChanged(AutoHideAnimation value);
103 void OnBacklightModeChanged(BacklightMode value);
104 void OnIconSizeChanged(int value);
105 void OnEdgeOptionChanged(int value);
106 void OnTileSizeChanged(int value);
107 void OnFloatingChanged(bool value);
108 void OnBackgroundAlphaChanged(float value);
109};97};
11098
111}99}
112100
=== modified file 'plugins/unityshell/src/PointerBarrier.cpp'
--- plugins/unityshell/src/PointerBarrier.cpp 2012-01-30 18:38:12 +0000
+++ plugins/unityshell/src/PointerBarrier.cpp 2012-02-01 01:11:26 +0000
@@ -44,6 +44,8 @@
44 smoothing = 75;44 smoothing = 75;
45 smoothing_count_ = 0;45 smoothing_count_ = 0;
46 smoothing_accum_ = 0;46 smoothing_accum_ = 0;
47 smoothing_handle_ = 0;
48 max_velocity_multiplier = 1.0f;
47}49}
4850
49void PointerBarrierWrapper::ConstructBarrier()51void PointerBarrierWrapper::ConstructBarrier()
@@ -108,7 +110,7 @@
108 BarrierEvent::Ptr event (new BarrierEvent());110 BarrierEvent::Ptr event (new BarrierEvent());
109 event->x = last_x_;111 event->x = last_x_;
110 event->y = last_y_;112 event->y = last_y_;
111 event->velocity = std::min<int> (600, smoothing_accum_ / smoothing_count_);113 event->velocity = std::min<int> (600 * max_velocity_multiplier, smoothing_accum_ / smoothing_count_);
112 event->event_id = last_event_;114 event->event_id = last_event_;
113115
114 barrier_event.emit(this, event);116 barrier_event.emit(this, event);
@@ -125,16 +127,6 @@
125127
126 if (notify_event->barrier == barrier && notify_event->subtype == XFixesBarrierHitNotify)128 if (notify_event->barrier == barrier && notify_event->subtype == XFixesBarrierHitNotify)
127 {129 {
128 if (notify_event->event_id != last_event_)
129 {
130 EmitCurrentData();
131 if (smoothing_handle_)
132 {
133 g_source_remove(smoothing_handle_);
134 smoothing_handle_ = 0;
135 }
136 }
137
138 last_x_ = notify_event->x;130 last_x_ = notify_event->x;
139 last_y_ = notify_event->y;131 last_y_ = notify_event->y;
140 last_event_ = notify_event->event_id;132 last_event_ = notify_event->event_id;
141133
=== modified file 'plugins/unityshell/src/PointerBarrier.h'
--- plugins/unityshell/src/PointerBarrier.h 2012-01-27 03:28:20 +0000
+++ plugins/unityshell/src/PointerBarrier.h 2012-02-01 01:11:26 +0000
@@ -57,6 +57,8 @@
5757
58 nux::Property<int> smoothing;58 nux::Property<int> smoothing;
5959
60 nux::Property<float> max_velocity_multiplier;
61
60 PointerBarrierWrapper();62 PointerBarrierWrapper();
6163
62 void ConstructBarrier();64 void ConstructBarrier();
6365
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-01-29 22:41:55 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-02-01 01:11:26 +0000
@@ -309,6 +309,7 @@
309309
310 optionSetStopVelocityNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));310 optionSetStopVelocityNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
311 optionSetRevealPressureNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));311 optionSetRevealPressureNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
312 optionSetEdgeResponsivenessNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
312 optionSetOvercomePressureNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));313 optionSetOvercomePressureNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
313 optionSetDecayRateNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));314 optionSetDecayRateNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
314 optionSetShowMinimizedWindowsNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));315 optionSetShowMinimizedWindowsNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
@@ -2165,7 +2166,7 @@
2165 {2166 {
2166 nux::Geometry geo = launcher->GetAbsoluteGeometry();2167 nux::Geometry geo = launcher->GetAbsoluteGeometry();
2167 2168
2168 if (launcher->Hidden() || launcher->GetHideMode() == LAUNCHER_HIDE_NEVER || launcher->GetHideMode() == LAUNCHER_HIDE_AUTOHIDE)2169 if (launcher->Hidden() || launcher->options()->hide_mode == LAUNCHER_HIDE_NEVER || launcher->options()->hide_mode == LAUNCHER_HIDE_AUTOHIDE)
2169 continue;2170 continue;
2170 2171
2171 if (geo.IsInside(result))2172 if (geo.IsInside(result))
@@ -2368,6 +2369,8 @@
2368 break;2369 break;
2369 case UnityshellOptions::RevealPressure:2370 case UnityshellOptions::RevealPressure:
2370 launcher_options->edge_reveal_pressure = optionGetRevealPressure() * 100;2371 launcher_options->edge_reveal_pressure = optionGetRevealPressure() * 100;
2372 case UnityshellOptions::EdgeResponsiveness:
2373 launcher_options->edge_responsiveness = optionGetEdgeResponsiveness();
2371 break;2374 break;
2372 default:2375 default:
2373 break;2376 break;
23742377
=== modified file 'plugins/unityshell/unityshell.xml.in'
--- plugins/unityshell/unityshell.xml.in 2012-01-30 18:40:04 +0000
+++ plugins/unityshell/unityshell.xml.in 2012-02-01 01:11:26 +0000
@@ -268,6 +268,14 @@
268 <max>64</max>268 <max>64</max>
269 <precision>1</precision>269 <precision>1</precision>
270 </option>270 </option>
271 <option name="edge_responsiveness" type="float">
272 <_short>Launcher Reveal Edge Responsiveness</_short>
273 <_long>A conglomerate setting that modifies the overall responsiveness of the launcher reveal</_long>
274 <default>1.0</default>
275 <min>0.2</min>
276 <max>8.0</max>
277 <precision>0.1</precision>
278 </option>
271 <option name="reveal_pressure" type="int">279 <option name="reveal_pressure" type="int">
272 <_short>Launcher Reveal Pressure</_short>280 <_short>Launcher Reveal Pressure</_short>
273 <_long>Amount of mouse pressure required to reveal launcher</_long>281 <_long>Amount of mouse pressure required to reveal launcher</_long>