[gnome-shell/gbsneto/more-lock-screen-fixes: 2/3] unlockDialog: Only create GDM client once



commit 523eec521c841528e5e3df57580055e08c133960
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Feb 13 17:36:51 2020 -0300

    unlockDialog: Only create GDM client once
    
    We don't need to create a new one every time we create an
    auth prompt.
    
    Create only one GDM client.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/999

 js/ui/unlockDialog.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 0ca62430cc..dd6f971cff 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -465,6 +465,8 @@ var UnlockDialog = GObject.registerClass({
 
         parentActor.add_child(this);
 
+        this._gdmClient = new Gdm.Client();
+
         this._adjustment = new St.Adjustment({
             lower: 0,
             upper: 2,
@@ -615,7 +617,8 @@ var UnlockDialog = GObject.registerClass({
         if (this._authPrompt)
             return;
 
-        this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), 
AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
+        this._authPrompt = new AuthPrompt.AuthPrompt(this._gdmClient,
+            AuthPrompt.AuthPromptMode.UNLOCK_ONLY);
         this._authPrompt.connect('failed', this._fail.bind(this));
         this._authPrompt.connect('cancelled', this._fail.bind(this));
         this._authPrompt.connect('reset', this._onReset.bind(this));
@@ -765,6 +768,11 @@ var UnlockDialog = GObject.registerClass({
             themeContext.disconnect(this._scaleChangedId);
             delete this._scaleChangedId;
         }
+
+        if (this._gdmClient) {
+            this._gdmClient = null;
+            delete this._gdmClient;
+        }
     }
 
     cancel() {


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