Merge lp:~aacid/unity-2d/hide_launcher_on_fast_move_after_barrier_break into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 1024
Merged at revision: 1025
Proposed branch: lp:~aacid/unity-2d/hide_launcher_on_fast_move_after_barrier_break
Merge into: lp:unity-2d
Diff against target: 116 lines (+48/-2)
6 files modified
shell/common/visibilityBehaviors/AutoHideBehavior.qml (+8/-1)
shell/common/visibilityBehaviors/IntelliHideBehavior.qml (+2/-1)
shell/launcher/Launcher.qml (+2/-0)
tests/launcher/autohide_show_tests.rb (+4/-0)
tests/launcher/autohide_show_tests_common.rb (+28/-0)
tests/launcher/autohide_show_tests_rtl.rb (+4/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/hide_launcher_on_fast_move_after_barrier_break
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+100149@code.launchpad.net

Commit message

[launcher] Start the hide timer if on target animation end the mouse is not over the target

Description of the change

Start the hide timer if on target animation end the mouse is not over the target

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Nice fix approved, thank you

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/common/visibilityBehaviors/AutoHideBehavior.qml'
2--- shell/common/visibilityBehaviors/AutoHideBehavior.qml 2012-03-06 18:06:03 +0000
3+++ shell/common/visibilityBehaviors/AutoHideBehavior.qml 2012-03-30 13:49:20 +0000
4@@ -22,8 +22,9 @@
5 // in the edge of the target
6 // Hides the target when none of the above conditions are met
7 // and you have not had the mouse over it during more than 1000 msec
8-// To use this Behavior your target needs to provide one properties
9+// To use this Behavior your target needs to provide two properties
10 // - containsMouse: Defines if the mouse is inside the target
11+// - animating: Defines if the target is being animated
12 // and one signal
13 // - barrierTriggered: Defines when the pointer barrier has been triggered
14
15@@ -74,5 +75,11 @@
16 Connections {
17 target: autoHide.target !== undefined ? autoHide.target : null
18 onBarrierTriggered: shownRegardlessOfFocus = true
19+ onAnimatingChanged:
20+ {
21+ if (!target.animating && !target.containsMouse && shownRegardlessOfFocus) {
22+ autoHideTimer.start();
23+ }
24+ }
25 }
26 }
27
28=== modified file 'shell/common/visibilityBehaviors/IntelliHideBehavior.qml'
29--- shell/common/visibilityBehaviors/IntelliHideBehavior.qml 2012-03-12 10:52:13 +0000
30+++ shell/common/visibilityBehaviors/IntelliHideBehavior.qml 2012-03-30 13:49:20 +0000
31@@ -24,8 +24,9 @@
32 // or there are no windows that intersect with the target
33 // Hides the target when none of the above conditions are met
34 // and you have not had the mouse over it during more than 1000 msec
35-// To use this Behavior your target needs to provide one properties
36+// To use this Behavior your target needs to provide two properties
37 // - containsMouse: Defines if the mouse is inside the target
38+// - animating: Defines if the target is being animated
39 // and one signal
40 // - barrierTriggered: Defines when the pointer barrier has been triggered
41
42
43=== modified file 'shell/launcher/Launcher.qml'
44--- shell/launcher/Launcher.qml 2012-03-22 11:08:54 +0000
45+++ shell/launcher/Launcher.qml 2012-03-30 13:49:20 +0000
46@@ -31,6 +31,8 @@
47
48 property bool containsMouse: declarativeView.monitoredAreaContainsMouse
49
50+ property bool animating: launcherLoaderXAnimation.running
51+
52 function hideMenu() {
53 if (main.visibleMenu !== undefined) {
54 main.visibleMenu.hide()
55
56=== modified file 'tests/launcher/autohide_show_tests.rb'
57--- tests/launcher/autohide_show_tests.rb 2012-03-06 18:06:03 +0000
58+++ tests/launcher/autohide_show_tests.rb 2012-03-30 13:49:20 +0000
59@@ -199,4 +199,8 @@
60 test_auto_hide_launcher_hide_timer_and_hud_interaction()
61 end
62
63+ test "Auto Hide: Launcher mouse move just after barrier trigger" do
64+ test_auto_hide_launcher_mouse_move_just_after_barrier_trigger()
65+ end
66+
67 end
68
69=== modified file 'tests/launcher/autohide_show_tests_common.rb'
70--- tests/launcher/autohide_show_tests_common.rb 2012-03-06 18:06:03 +0000
71+++ tests/launcher/autohide_show_tests_common.rb 2012-03-30 13:49:20 +0000
72@@ -619,3 +619,31 @@
73 verify_launcher_visible(2)
74 }
75 end
76+
77+# Test case objectives:
78+# * Auto Hide: Launcher mouse move just after barrier trigger
79+# Pre-conditions
80+# * Desktop with no running applications
81+# Test steps
82+# * Set hide-mode to 1
83+# * Move mouse away from launcher
84+# * Verify Launcher hides
85+# * Move mouse to screen edge
86+# * Verify Launcher still hiding
87+# * Fake a barrier triggering
88+# * Move mouse away from the launcher
89+# * Verify Launcher hides
90+# Post-conditions
91+# * None
92+# References
93+# * https://bugs.launchpad.net/unity-2d/+bug/943296
94+def test_auto_hide_launcher_mouse_move_just_after_barrier_trigger
95+ $SUT.execute_shell_command 'gsettings set com.canonical.Unity2d.Launcher hide-mode 1'
96+ XDo::Mouse.move(300, 300, 0, true)
97+ verify_launcher_hidden(TIMEOUT, 'Launcher should not be visible immediately without pushing the edge')
98+ move_mouse_to_screen_edge()
99+ verify_launcher_hidden(0, 'Launcher should not be visible immediately without pushing the edge')
100+ @app.Launcher(:visibleOnScreen => 'false' ).call_method('barrierTriggered()')
101+ XDo::Mouse.move(300, 300, 0, true)
102+ verify_launcher_hidden(TIMEOUT, 'Launcher should not be visible after moving the mouse away')
103+end
104
105=== modified file 'tests/launcher/autohide_show_tests_rtl.rb'
106--- tests/launcher/autohide_show_tests_rtl.rb 2012-03-06 18:06:03 +0000
107+++ tests/launcher/autohide_show_tests_rtl.rb 2012-03-30 13:49:20 +0000
108@@ -200,4 +200,8 @@
109 test_auto_hide_launcher_hide_timer_and_hud_interaction()
110 end
111
112+ test "Auto Hide: Launcher mouse move just after barrier trigger" do
113+ test_auto_hide_launcher_mouse_move_just_after_barrier_trigger()
114+ end
115+
116 end

Subscribers

People subscribed via source and target branches