on xenial help sign in
Don't hide launcher when nothing happens on long left edge swipes Fixes: 1357333

Approved by: Albert Astals Cid

commit318e81a0e9ac691cbfa07ee66bd3052ff0c785ce authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 18 Sep 2014, 21:22 (12 years ago) parentd276e0e6e1c315
3 files changed+19−9
qml/Launcher/Launcher.qml+1−2 qml/Shell.qml+5−1 tests/qmltests/tst_Shell.qml+13−6
qml/Launcher/Launcher.qml+1−2
@@ -243,10 +243,9 @@ Item {
243243 onDraggingChanged: {
244244 if (!dragging) {
245245 if (distance > panel.width / 2) {
246+ root.switchToNextState("visible")
246247 if (distance > minimizeDistance) {
247248 root.dash();
248− } else {
249− root.switchToNextState("visible")
250249 }
251250 } else {
252251 root.switchToNextState("")
qml/Shell.qml+5−1
@@ -564,7 +564,11 @@ Item {
564564 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && greeter.fakeActiveForApp === ""
565565
566566 onShowDashHome: showHome()
567− onDash: showDash()
567+ onDash: {
568+ if (ApplicationManager.focusedApplicationId != "unity8-dash") {
569+ showDash()
570+ }
571+ }
568572 onDashSwipeChanged: {
569573 if (dashSwipe) {
570574 dash.setCurrentScope("clickscope", false, true)
tests/qmltests/tst_Shell.qml+13−6
@@ -170,10 +170,11 @@ Row {
170170
171171 function test_leftEdgeDrag_data() {
172172 return [
173− {tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true},
174− {tag: "with launcher", revealLauncher: true, swipeLength: units.gu(27), appHides: true},
175− {tag: "small swipe", revealLauncher: false, swipeLength: units.gu(25), appHides: false},
176− {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true}
173+ {tag: "without launcher", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true},
174+ {tag: "with launcher", revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true},
175+ {tag: "small swipe", revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app", launcherHides: false},
176+ {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app", launcherHides: true},
177+ {tag: "long swipe", revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash", launcherHides: false}
177178 ];
178179 }
179180
@@ -181,16 +182,22 @@ Row {
181182 dragLauncherIntoView();
182183 tapOnAppIconInLauncher();
183184 waitUntilApplicationWindowIsFullyVisible();
185+ ApplicationManager.focusApplication(data.focusedApp)
186+ waitUntilApplicationWindowIsFullyVisible();
184187
185188 if (data.revealLauncher) {
186189 dragLauncherIntoView();
187190 }
188191
189192 swipeFromLeftEdge(data.swipeLength);
190− if (data.appHides)
193+ if (data.appHides) {
191194 waitUntilDashIsFocused();
192− else
195+ } else {
193196 waitUntilApplicationWindowIsFullyVisible();
197+ }
198+
199+ var launcher = findChild(shell, "launcherPanel");
200+ tryCompare(launcher, "x", data.launcherHides ? -launcher.width : 0)
194201 }
195202
196203 function test_suspend() {