From 8dc9ceb2bcb1511f77c3e457dbbd775b70ab2a5c Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 17 Aug 2012 19:08:17 +0200 Subject: [PATCH] ScreenShield: make .lock() and .unlock() idempotent Those methods can be called multiple times in certain situations, and will be even more so after hooking them to the system bus. --- js/ui/screenShield.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index f37541769..c4a23b6e9 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -616,11 +616,13 @@ const ScreenShield = new Lang.Class({ this._lightbox.hide(); - Main.popModal(this.actor); - this.actor.hide(); + if (this._isModal) { + Main.popModal(this.actor); + this._isModal = false; + } - this._isModal = false; this._isLocked = false; + this.actor.hide(); this.emit('lock-status-changed', false); },