[gnome-shell] ScreenShield: fix code to detect missing unlock dialog
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] ScreenShield: fix code to detect missing unlock dialog
- Date: Sun, 11 Nov 2012 18:19:02 +0000 (UTC)
commit 271508c0a871ae508b94e06a7d11985b5998bc12
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Tue Nov 6 23:41:51 2012 +0100
ScreenShield: fix code to detect missing unlock dialog
If the session mode has no locking support, screenshield had code to
unlock automatically, but it did so by checking the return value of
the constructor, instead of checking if the constructor was actually
callable, so it would get a TypeError before reaching the check.
https://bugzilla.gnome.org/show_bug.cgi?id=687708
js/ui/screenShield.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 7c7c7c0..8de5c62 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -713,13 +713,15 @@ const ScreenShield = new Lang.Class({
_ensureUnlockDialog: function(onPrimary) {
if (!this._dialog) {
let constructor = Main.sessionMode.unlockDialog;
- this._dialog = new constructor(this._lockDialogGroup);
- if (!this._dialog) {
+ if (!constructor) {
// This session mode has no locking capabilities
this.unlock();
return;
}
+ this._dialog = new constructor(this._lockDialogGroup);
+
+
let time = global.get_current_time();
this._dialog.connect('loaded', Lang.bind(this, function() {
if (!this._dialog.open(time, onPrimary)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]