on xenial help sign in
Don't show() the lockscreen if it's already being shown
266b7ecDaniel d'Andrada
qml/Shell.qml+1−1
@@ -411,7 +411,7 @@ Item {
411 onShownChanged: if (shown) greeter.lockedApp = ""
411 onShownChanged: if (shown) greeter.lockedApp = ""
412
412
413 function maybeShow() {
413 function maybeShow() {
414− if (!shell.forcedUnlock) {
414+ if (!shell.forcedUnlock && !shown) {
415 showNow();
415 showNow();
416 }
416 }
417 }
417 }
tests/qmltests/tst_ShellWithPin.qml+48
@@ -511,5 +511,53 @@ Item {
511 var lockscreen = findChild(shell, "lockscreen");
511 var lockscreen = findChild(shell, "lockscreen");
512 verify(lockscreen.shown);
512 verify(lockscreen.shown);
513 }
513 }
514+
515+ /*
516+ Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1393447
517+
518+ Do a left edge drag that is long enough to start displacing the greeter
519+ but short engough so that the greeter comes back into place once the
520+ finger is lifted.
521+
522+ In this situation the launcher should remaing fully shown and hide itself
523+ only after its idle timeout is triggered.
524+ */
525+ function test_shortLeftEdgeSwipeMakesLauncherStayVisible() {
526+ var greeter = testCase.findChild(shell, "greeter")
527+ greeter.show();
528+ tryCompare(greeter, "showProgress", 1);
529+
530+ var launcher = testCase.findChild(shell, "launcher")
531+ {
532+ var dismissTimer = testCase.findInvisibleChild(launcher, "dismissTimer");
533+ // effectively disable the dismiss timer
534+ dismissTimer.interval = 24 * 60 * 60 * 1000 // 24 hours
535+ }
536+ var launcherPanel = testCase.findChild(launcher, "launcherPanel");
537+
538+ var toX = shell.width * 0.45;
539+ touchFlick(shell,
540+ 1 /* fromX */, shell.height * 0.5 /* fromY */,
541+ toX /* toX */, shell.height * 0.5 /* toY */,
542+ true /* beginTouch */, false /* endTouch */,
543+ 50, 100);
544+
545+ // Launcher must be fully shown by now
546+ tryCompare(launcherPanel, "x", 0);
547+
548+ // Greeter should be displaced
549+ tryCompareFunction(function() { return greeter.mapToItem(shell, 0, 0).x > shell.width*0.2; }, true);
550+
551+ touchRelease(shell, toX, shell.height * 0.5);
552+
553+ // Upon release the greeter should have slid back into full view
554+ tryCompareFunction(function() { return greeter.mapToItem(shell, 0, 0).x === 0; }, true);
555+
556+ // And the launcher should stay fully shown
557+ for (var i = 0; i < 10; ++i) {
558+ wait(50);
559+ compare(launcherPanel.x, 0);
560+ }
561+ }
514 }
562 }
515}
563}