on xenial help sign in
move connection into greeter
44c3751Michael Terry
Shell.qml+37−19
@@ -98,17 +98,6 @@ FocusScope {
98 }
98 }
99 }
99 }
100
100
101− onCurrentFocusedAppIdChanged: {
102− // If any app is focused when greeter is open, it's due to a user action
103− // like a snap decision (say, an incoming call).
104− // TODO: this should be protected to only unlock for certain applications / certain usecases
105− // potentially only in connection with a notification.
106− if (greeter.shown && currentFocusedAppId) {
107− greeter.hide()
108− }
109− hud.hide()
110− }
111−
112 function activateApplication(desktopFile, argument) {
101 function activateApplication(desktopFile, argument) {
113 if (applicationManager) {
102 if (applicationManager) {
114 // For newly started applications, as it takes them time to draw their first frame
103 // For newly started applications, as it takes them time to draw their first frame
@@ -476,17 +465,17 @@ FocusScope {
476
465
477 function setFocused(focused) {
466 function setFocused(focused) {
478 if (!focused) {
467 if (!focused) {
479− previousMainApp = applicationManager.mainStageFocusedApplication;
468+ greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
480− previousSideApp = applicationManager.sideStageFocusedApplication;
469+ greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
481 applicationManager.unfocusCurrentApplication();
470 applicationManager.unfocusCurrentApplication();
482 } else {
471 } else {
483− if (previousMainApp) {
472+ if (greeter.previousMainApp) {
484− applicationManager.focusApplication(previousMainApp);
473+ applicationManager.focusApplication(greeter.previousMainApp);
485− previousMainApp = null;
474+ greeter.previousMainApp = null;
486 }
475 }
487− if (previousSideApp) {
476+ if (greeter.previousSideApp) {
488− applicationManager.focusApplication(previousSideApp);
477+ applicationManager.focusApplication(greeter.previousSideApp);
489− previousSideApp = null;
478+ greeter.previousSideApp = null;
490 }
479 }
491 }
480 }
492 }
481 }
@@ -520,6 +509,29 @@ FocusScope {
520 launcher.tease();
509 launcher.tease();
521 }
510 }
522 }
511 }
512+
513+ Connections {
514+ target: applicationManager
515+ ignoreUnknownSignals: true
516+ // If any app is focused when greeter is open, it's due to a user action
517+ // like a snap decision (say, an incoming call).
518+ // TODO: these should be protected to only unlock for certain applications / certain usecases
519+ // potentially only in connection with a notification.
520+ onMainStageFocusedApplicationChanged: {
521+ if (greeter.shown && applicationManager.mainStageFocusedApplication) {
522+ greeter.previousMainApp = null // make way for new focused app
523+ greeter.previousSideApp = null
524+ greeter.hide()
525+ }
526+ }
527+ onSideStageFocusedApplicationChanged: {
528+ if (greeter.shown && applicationManager.sideStageFocusedApplication) {
529+ greeter.previousMainApp = null // make way for new focused app
530+ greeter.previousSideApp = null
531+ greeter.hide()
532+ }
533+ }
534+ }
523 }
535 }
524
536
525 InputFilterArea {
537 InputFilterArea {
@@ -597,6 +609,12 @@ FocusScope {
597 shown: false
609 shown: false
598 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
610 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
599 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
611 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
612+
613+ Connections {
614+ target: shell.applicationManager
615+ onMainStageFocusedApplicationChanged: hud.hide()
616+ onSideStageFocusedApplicationChanged: hud.hide()
617+ }
600 }
618 }
601
619
602 Revealer {
620 Revealer {