on xenial help sign in
Don't show() the lockscreen if it's already being shown

As is has the side-effect of hiding the launcher and indicators panel.

commitcd90ce01d7c2cd6063f0372ab0218d7929fef66c authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 21 Jan 2015, 13:45 (12 years ago) parent8851986
2 files changed+50−1
qml/Shell.qml+1−1 tests/qmltests/tst_ShellWithPin.qml+49
qml/Shell.qml+1−1
@@ -399,7 +399,7 @@ Item {
399399 onShownChanged: if (shown) greeter.lockedApp = ""
400400
401401 function maybeShow() {
402− if (!shell.forcedUnlock) {
402+ if (!shell.forcedUnlock && !shown) {
403403 showNow();
404404 }
405405 }
tests/qmltests/tst_ShellWithPin.qml+49
@@ -503,5 +503,54 @@ Item {
503503 var lockscreen = findChild(shell, "lockscreen");
504504 verify(lockscreen.shown);
505505 }
506+
507+ /*
508+ Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1393447
509+
510+ Do a left edge drag that is long enough to start displacing the greeter
511+ but short engough so that the greeter comes back into place once the
512+ finger is lifted.
513+
514+ In this situation the launcher should remaing fully shown and hide itself
515+ only after its idle timeout is triggered.
516+ */
517+ function test_shortLeftEdgeSwipeMakesLauncherStayVisible() {
518+ var greeter = testCase.findChild(shell, "greeter")
519+ greeter.show();
520+ // wait until the animation has finished (ie, greeter is fully visible)
521+ tryCompareFunction(function() { return greeter.mapToItem(shell, 0, 0).x === 0; }, true);
522+
523+ var launcher = testCase.findChild(shell, "launcher")
524+ {
525+ var dismissTimer = testCase.findInvisibleChild(launcher, "dismissTimer");
526+ // effectively disable the dismiss timer
527+ dismissTimer.interval = 24 * 60 * 60 * 1000 // 24 hours
528+ }
529+ var launcherPanel = testCase.findChild(launcher, "launcherPanel");
530+
531+ var toX = shell.width * 0.45;
532+ touchFlick(shell,
533+ 1 /* fromX */, shell.height * 0.5 /* fromY */,
534+ toX /* toX */, shell.height * 0.5 /* toY */,
535+ true /* beginTouch */, false /* endTouch */,
536+ 50, 100);
537+
538+ // Launcher must be fully shown by now
539+ tryCompare(launcherPanel, "x", 0);
540+
541+ // Greeter should be displaced
542+ tryCompareFunction(function() { return greeter.mapToItem(shell, 0, 0).x > shell.width*0.2; }, true);
543+
544+ touchRelease(shell, toX, shell.height * 0.5);
545+
546+ // Upon release the greeter should have slid back into full view
547+ tryCompareFunction(function() { return greeter.mapToItem(shell, 0, 0).x === 0; }, true);
548+
549+ // And the launcher should stay fully shown
550+ for (var i = 0; i < 10; ++i) {
551+ wait(50);
552+ compare(launcherPanel.x, 0);
553+ }
554+ }
506555 }
507556}