@@ -211,16 +211,10 @@ FocusScope {
211211
212212 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
213213 opacity: 1.0 - disappearingAnimationProgress
214− property real disappearingAnimationProgress: {
215− if (greeter.shown) {
216− return greeter.showProgress;
217− } else {
218− return stagesOuterContainer.showProgress;
219− }
220− }
214+ property real disappearingAnimationProgress: stagesOuterContainer.showProgress
221215
222− // FIXME: only necessary because stagesOuterContainer.showProgress and
223− // greeterRevealer.animatedProgress are not animated
216+ // FIXME: only necessary because stagesOuterContainer.showProgress
217+ // is not animated
224218 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
225219 }
226220 }
@@ -453,90 +447,94 @@ FocusScope {
453447 }
454448 }
455449
456− Greeter {
457− id: greeter
458− objectName: "greeter"
450+ Item {
451+ // Just a tiny wrapper to adjust greeter's x without messing with its own dragging
452+ width: parent.width
453+ height: parent.height
454+ x: launcher.progress
455+ Behavior on x {SmoothedAnimation{velocity: 600}}
459456
460− available: true
461− hides: [launcher, panel.indicators, hud]
462− shown: true
457+ Greeter {
458+ id: greeter
459+ objectName: "greeter"
463460
464− defaultBackground: shell.background
461+ available: true
462+ hides: [launcher, panel.indicators, hud]
463+ shown: true
465464
466− y: panel.panelHeight
467− width: parent.width
468− height: parent.height - panel.panelHeight
465+ defaultBackground: shell.background
469466
470− dragHandleWidth: shell.edgeSize
467+ y: panel.panelHeight
468+ width: parent.width
469+ height: parent.height - panel.panelHeight
471470
472− property var previousMainApp: null
473− property var previousSideApp: null
471+ dragHandleWidth: shell.edgeSize
474472
475− function removeApplicationFocus() {
476− greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
477− greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
478− applicationManager.unfocusCurrentApplication();
479− }
473+ property var previousMainApp: null
474+ property var previousSideApp: null
480475
481− function restoreApplicationFocus() {
482− if (greeter.previousMainApp) {
483− applicationManager.focusApplication(greeter.previousMainApp);
484− greeter.previousMainApp = null;
476+ function removeApplicationFocus() {
477+ greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
478+ greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
479+ applicationManager.unfocusCurrentApplication();
485480 }
486− if (greeter.previousSideApp) {
487− applicationManager.focusApplication(greeter.previousSideApp);
488− greeter.previousSideApp = null;
489− }
490− }
491481
492− onShownChanged: {
493− if (shown) {
494− lockscreen.reset();
495− // If there is only one user, we start authenticating with that one here.
496− // If there are more users, the Greeter will handle that
497− if (LightDM.Users.count == 1) {
498− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
482+ function restoreApplicationFocus() {
483+ if (greeter.previousMainApp) {
484+ applicationManager.focusApplication(greeter.previousMainApp);
485+ greeter.previousMainApp = null;
486+ }
487+ if (greeter.previousSideApp) {
488+ applicationManager.focusApplication(greeter.previousSideApp);
489+ greeter.previousSideApp = null;
499490 }
500− greeter.forceActiveFocus();
501− removeApplicationFocus();
502− } else {
503− restoreApplicationFocus();
504491 }
505− }
506492
507− onUnlocked: greeter.hide()
508− onSelected: {
509− // Update launcher items for new user
510− var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
511− AccountsService.user = user;
512− LauncherModel.setUser(user);
513− }
493+ onShownChanged: {
494+ if (shown) {
495+ lockscreen.reset();
496+ // If there is only one user, we start authenticating with that one here.
497+ // If there are more users, the Greeter will handle that
498+ if (LightDM.Users.count == 1) {
499+ LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
500+ }
501+ greeter.forceActiveFocus();
502+ removeApplicationFocus();
503+ } else {
504+ restoreApplicationFocus();
505+ }
506+ }
514507
515− onLeftTeaserPressedChanged: {
516− if (leftTeaserPressed) {
517− launcher.tease();
508+ onUnlocked: greeter.hide()
509+ onSelected: {
510+ // Update launcher items for new user
511+ var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
512+ AccountsService.user = user;
513+ LauncherModel.setUser(user);
518514 }
519− }
520515
521− Connections {
522− target: applicationManager
523− ignoreUnknownSignals: true
524− // If any app is focused when greeter is open, it's due to a user action
525− // like a snap decision (say, an incoming call).
526− // TODO: these should be protected to only unlock for certain applications / certain usecases
527− // potentially only in connection with a notification.
528− onMainStageFocusedApplicationChanged: {
529− if (greeter.shown && applicationManager.mainStageFocusedApplication) {
530− greeter.previousMainApp = null // make way for new focused app
531− greeter.previousSideApp = null
532− greeter.hide()
516+ onTease: launcher.tease() //launcher.state = "visible"
517+
518+ Connections {
519+ target: applicationManager
520+ ignoreUnknownSignals: true
521+ // If any app is focused when greeter is open, it's due to a user action
522+ // like a snap decision (say, an incoming call).
523+ // TODO: these should be protected to only unlock for certain applications / certain usecases
524+ // potentially only in connection with a notification.
525+ onMainStageFocusedApplicationChanged: {
526+ if (greeter.shown && applicationManager.mainStageFocusedApplication) {
527+ greeter.previousMainApp = null // make way for new focused app
528+ greeter.previousSideApp = null
529+ greeter.hide()
530+ }
533531 }
534− }
535− onSideStageFocusedApplicationChanged: {
536− if (greeter.shown && applicationManager.sideStageFocusedApplication) {
537− greeter.previousMainApp = null // make way for new focused app
538− greeter.previousSideApp = null
539− greeter.hide()
532+ onSideStageFocusedApplicationChanged: {
533+ if (greeter.shown && applicationManager.sideStageFocusedApplication) {
534+ greeter.previousMainApp = null // make way for new focused app
535+ greeter.previousSideApp = null
536+ greeter.hide()
537+ }
540538 }
541539 }
542540 }
@@ -681,6 +679,8 @@ FocusScope {
681679 stages.hide();
682680 launcher.hide();
683681 }
682+ if (greeter.shown)
683+ greeter.hideRight();
684684 }
685685 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("applications.scope", false, true)
686686 onLauncherApplicationSelected:{