Skip to content

Commit 2e65052

Browse files
committed
screenShield.js: Don't react twice to loginManager session signals.
The loginManager's active-changed is used to pop the unlock dialog, but it also fires when the session has been unlocked via the greeter, along with its unlock signal. Skip the active-changed handling when we're already in the process of unlocking.
1 parent 86eef33 commit 2e65052

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

js/ui/screensaver/screenShield.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ var ScreenShield = GObject.registerClass({
130130
this._infoPanel = null;
131131
this._inhibitor = null;
132132
this._activationPending = false;
133+
this._deactivating = false;
133134

134135
this._nameBlocker = new NameBlocker.NameBlocker();
135136

@@ -397,9 +398,7 @@ var ScreenShield = GObject.registerClass({
397398
_log('ScreenShield: Unlocking screen');
398399
this._loginManager.setLockedHint(false);
399400

400-
if (this._state === State.UNLOCKING) {
401-
this._dialog.hide();
402-
}
401+
this._dialog.hide();
403402

404403
this._hideShield(true);
405404
}
@@ -558,6 +557,7 @@ var ScreenShield = GObject.registerClass({
558557
}
559558

560559
_hideShield(emitUnlocked) {
560+
this._deactivating = true;
561561
this._hideScreensaverKeyboard();
562562
this._keyboardBox.hide();
563563
this._backupLockerCall('Unlock', null);
@@ -586,6 +586,7 @@ var ScreenShield = GObject.registerClass({
586586

587587
this._activationTime = 0;
588588
this._setState(State.HIDDEN);
589+
this._deactivating = false;
589590

590591
if (emitUnlocked)
591592
this.emit('unlocked');
@@ -675,6 +676,8 @@ var ScreenShield = GObject.registerClass({
675676
_log(`ScreenShield: Received active-changed signal from LoginManager (active=${active}, state=${this._state})`);
676677
if (!active)
677678
return;
679+
if (this._deactivating)
680+
return;
678681
if (this._state === State.LOCKED) {
679682
this.showUnlockDialog();
680683
}

0 commit comments

Comments
 (0)