@@ -103,7 +103,10 @@ FocusScope {
103 // like a snap decision (say, an incoming call).
103 // like a snap decision (say, an incoming call).
104 // TODO: this should be protected to only unlock for certain applications / certain usecases
104 // TODO: this should be protected to only unlock for certain applications / certain usecases
105 // potentially only in connection with a notification.
105 // potentially only in connection with a notification.
106+ if (greeter.shown && currentFocusedAppId) {
106− greeter.hide()
109+ hud.hide()
109 function activateApplication(desktopFile, argument) {
112 function activateApplication(desktopFile, argument) {
@@ -468,6 +471,26 @@ FocusScope {
469 dragHandleWidth: shell.edgeSize
472 dragHandleWidth: shell.edgeSize
474+ property var previousMainApp: null
475+ property var previousSideApp: null
477+ function setFocused(focused) {
479+ previousMainApp = applicationManager.mainStageFocusedApplication;
480+ previousSideApp = applicationManager.sideStageFocusedApplication;
481+ applicationManager.unfocusCurrentApplication();
483+ if (previousMainApp) {
484+ applicationManager.focusApplication(previousMainApp);
485+ previousMainApp = null;
487+ if (previousSideApp) {
488+ applicationManager.focusApplication(previousSideApp);
489+ previousSideApp = null;
471 onShownChanged: {
494 onShownChanged: {
472 if (shown) {
495 if (shown) {
473 lockscreen.reset();
496 lockscreen.reset();
@@ -478,6 +501,9 @@ FocusScope {
478 greeter.selected(0);
501 greeter.selected(0);
480 greeter.forceActiveFocus();
503 greeter.forceActiveFocus();
@@ -506,34 +532,11 @@ FocusScope {
506 id: powerConnection
532 id: powerConnection
507 target: Powerd
533 target: Powerd
509− property var previousMainApp: null
510− property var previousSideApp: null
512− function setFocused(focused) {
514− powerConnection.previousMainApp = applicationManager.mainStageFocusedApplication;
515− powerConnection.previousSideApp = applicationManager.sideStageFocusedApplication;
516− applicationManager.unfocusCurrentApplication();
518− if (powerConnection.previousMainApp) {
519− applicationManager.focusApplication(powerConnection.previousMainApp);
520− powerConnection.previousMainApp = null;
522− if (powerConnection.previousSideApp) {
523− applicationManager.focusApplication(powerConnection.previousSideApp);
524− powerConnection.previousSideApp = null;
529 onDisplayPowerStateChange: {
535 onDisplayPowerStateChange: {
530 // We ignore any display-off signals when the proximity sensor
536 // We ignore any display-off signals when the proximity sensor
531 // is active. This usually indicates something like a phone call.
537 // is active. This usually indicates something like a phone call.
532 if (status == Powerd.Off && (flags & Powerd.UseProximity) == 0) {
538 if (status == Powerd.Off && (flags & Powerd.UseProximity) == 0) {
533− powerConnection.setFocused(false);
534 greeter.showNow();
539 greeter.showNow();
535− } else if (status == Powerd.On) {
536− powerConnection.setFocused(true);
539 // No reason to chew demo CPU when user isn't watching
542 // No reason to chew demo CPU when user isn't watching
@@ -594,12 +597,6 @@ FocusScope {
594 shown: false
597 shown: false
595 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
598 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
596 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
599 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
599− target: shell.applicationManager
600− onMainStageFocusedApplicationChanged: hud.hide()
601− onSideStageFocusedApplicationChanged: hud.hide()
605 Revealer {
602 Revealer {