[gnome-shell/eos3.8: 167/255] payg: Integrate the PAYG unlock screen with the login screen



commit 46ff68c19ad30deb0551e6ecbf38e10fff10bb61
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Mon Mar 26 14:09:05 2018 +0100

    payg: Integrate the PAYG unlock screen with the login screen
    
    We need to create a new session mode for this instead of simply
    reusing the other mode for PAYG since we will be in 'greeter mode'
    there, and make sure to push such mode from the right place.
    
    https://phabricator.endlessm.com/T21609

 js/ui/screenShield.js | 9 ++++++++-
 js/ui/sessionMode.js  | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 50aaeb263b..bf943b5d88 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -162,9 +162,10 @@ var ScreenShield = class {
                 return;
             }
 
+            let paygExpectedMode = this._isGreeter ? 'gdm-unlock-dialog-payg' : 'unlock-dialog-payg';
             if (Main.sessionMode.currentMode === 'unlock-dialog-payg') {
                 // This is the most common case.
-                Main.sessionMode.popMode('unlock-dialog-payg');
+                Main.sessionMode.popMode(paygExpectedMode);
             }
 
             // The machine is unlocked but we still need to unlock the
@@ -357,6 +358,10 @@ var ScreenShield = class {
         this.actor.show();
         this._isGreeter = Main.sessionMode.isGreeter;
         this._isLocked = true;
+
+        if (this._isGreeter && Main.paygManager.isLocked)
+            Main.sessionMode.pushMode('gdm-unlock-dialog-payg');
+
         this._ensureUnlockDialog(true);
     }
 
@@ -529,6 +534,8 @@ var ScreenShield = class {
     _continueDeactivate(animate) {
         this._hideLockScreen(animate);
 
+        if (Main.sessionMode.currentMode === 'gdm-unlock-dialog-payg')
+            Main.sessionMode.popMode('gdm-unlock-dialog-payg');
         if (Main.sessionMode.currentMode === 'unlock-dialog-payg')
             Main.sessionMode.popMode('unlock-dialog-payg');
         if (Main.sessionMode.currentMode == 'unlock-dialog')
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index bbd6ecf3ed..7e6c5fba26 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -54,6 +54,11 @@ const _modes = {
         panelStyle: 'login-screen',
     },
 
+    'gdm-unlock-dialog-payg': {
+        parentMode: 'gdm',
+        unlockDialog: imports.ui.paygUnlockDialog.PaygUnlockDialog,
+    },
+
     'unlock-dialog': {
         isLocked: true,
         unlockDialog: imports.ui.unlockDialog.UnlockDialog,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]