From aefdf15a45f21030f98dec3c2185d710836a5309 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 8 Jun 2013 17:22:43 +0200 Subject: [PATCH] ScreenShield: don't lock if the user has no password If the user has no configured password (like the default user in a live cd), the behavior should be as if the session was not locked at all. https://bugzilla.gnome.org/show_bug.cgi?id=701495 --- js/ui/screenShield.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 89601c0ea..4776333ff 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -1,5 +1,6 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- +const AccountsService = imports.gi.AccountsService; const Cairo = imports.cairo; const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; @@ -1245,7 +1246,14 @@ const ScreenShield = new Lang.Class({ St.Clipboard.get_default().set_text(St.ClipboardType.CLIPBOARD, ''); St.Clipboard.get_default().set_text(St.ClipboardType.PRIMARY, ''); - this._isLocked = true; + let userManager = AccountsService.UserManager.get_default(); + let user = userManager.get_user(GLib.get_user_name()); + + if (this._isGreeter) + this._isLocked = true; + else + this._isLocked = user.password_mode != AccountsService.UserPasswordMode.NONE; + this.activate(animate); this.emit('locked-changed');