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.
This commit is contained in:
Giovanni Campagna 2012-08-17 19:08:17 +02:00
parent 6cb713b0e3
commit 8dc9ceb2bc

View File

@ -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);
},