on xenial help sign in
Don't block handling power events on loading the greeter's qml and the background image.
a480428Michael Terry
qml/Greeter/Infographics.qml+9−7
@@ -127,7 +127,7 @@ Item {
127
127
128 index: model.index
128 index: model.index
129 count: pastCircles.count
129 count: pastCircles.count
130− radius: parent.width / 2
130+ radius: dataCircle.width / 2
131 halfSize: pastCircle.width / 2
131 halfSize: pastCircle.width / 2
132 posOffset: 0.0
132 posOffset: 0.0
133
133
@@ -187,7 +187,7 @@ Item {
187
187
188 index: model.index
188 index: model.index
189 count: presentCircles.count
189 count: presentCircles.count
190− radius: parent.width / 2
190+ radius: dataCircle.width / 2
191 halfSize: presentCircle.width / 2
191 halfSize: presentCircle.width / 2
192 posOffset: 0.0
192 posOffset: 0.0
193
193
@@ -255,14 +255,16 @@ Item {
255 interval: animDuration * 0.5; running: false; repeat: true
255 interval: animDuration * 0.5; running: false; repeat: true
256 onTriggered: {
256 onTriggered: {
257 if (dotCounter < dots.count) {
257 if (dotCounter < dots.count) {
258− var nextDot = dots.itemAt(dotCounter++)
258+ var nextDot = dots.itemAt(dotCounter);
259+ if (nextDot) {
259− nextDot.unlockAnimation.start()
260+ nextDot.unlockAnimation.start();
261+ if (++dotCounter == Math.round(dots.count / 2)) {
262+ circleChangeAnimTimer.startFromBeginning();
263+ }
264+ }
260 } else {
265 } else {
261 stop()
266 stop()
262 }
267 }
263− if (dotCounter == Math.round(dots.count / 2)) {
264− circleChangeAnimTimer.startFromBeginning()
265− }
266 }
268 }
267
269
268 function startFromBeginning() {
270 function startFromBeginning() {
qml/Shell.qml+20−2
@@ -400,7 +400,7 @@ Item {
400
400
401 function maybeShow() {
401 function maybeShow() {
402 if (!shell.forcedUnlock) {
402 if (!shell.forcedUnlock) {
403− show()
403+ showNow();
404 }
404 }
405 }
405 }
406
406
@@ -594,6 +594,15 @@ Item {
594 enabled = true;
594 enabled = true;
595 }
595 }
596
596
597+ Timer {
598+ // See powerConnection for why this is useful
599+ id: showGreeterDelayed
600+ interval: 1
601+ onTriggered: {
602+ greeter.showNow();
603+ }
604+ }
605+
597 onShownChanged: {
606 onShownChanged: {
598 if (shown) {
607 if (shown) {
599 // Disable everything so that user can't swipe greeter or
608 // Disable everything so that user can't swipe greeter or
@@ -664,7 +673,16 @@ Item {
664 onStatusChanged: {
673 onStatusChanged: {
665 if (Powerd.status === Powerd.Off && reason !== Powerd.Proximity &&
674 if (Powerd.status === Powerd.Off && reason !== Powerd.Proximity &&
666 !callManager.hasCalls && !edgeDemo.running) {
675 !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();
668 }
686 }
669 }
687 }
670 }
688 }