@@ -400,7 +400,7 @@ Item {
400400
401401 function maybeShow() {
402402 if (!shell.forcedUnlock) {
403− show()
403+ showNow();
404404 }
405405 }
406406
@@ -594,6 +594,15 @@ Item {
594594 enabled = true;
595595 }
596596
597+ Timer {
598+ // See powerConnection for why this is useful
599+ id: showGreeterDelayed
600+ interval: 1
601+ onTriggered: {
602+ greeter.showNow();
603+ }
604+ }
605+
597606 onShownChanged: {
598607 if (shown) {
599608 // Disable everything so that user can't swipe greeter or
@@ -664,7 +673,16 @@ Item {
664673 onStatusChanged: {
665674 if (Powerd.status === Powerd.Off && reason !== Powerd.Proximity &&
666675 !callManager.hasCalls && !edgeDemo.running) {
667− greeter.showNow()
676+ // We don't want to simply call greeter.showNow() here, because
677+ // that will take too long. Qt will delay button event
678+ // handling until the greeter is done loading and may think the
679+ // user held down the power button the whole time, leading to a
680+ // power dialog being shown. Instead, delay showing the
681+ // greeter until we've finished handling the event. We could
682+ // make the greeter load asynchronously instead, but that
683+ // introduces a whole host of timing issues, especially with
684+ // its animations. So this is simpler.
685+ showGreeterDelayed.start();
668686 }
669687 }
670688 }