From 118d55699176b5a34b04d4bc4f7ab371fa4661dd Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 6 May 2021 09:32:48 -0400 Subject: [PATCH] unlockDialog: Honor switch user lockdown settings At the moment user switching functionality is controlled by two settings: org.gnome.desktop.lockdown disable-user-switching for the panel when the session is unlocked, and org.gnome.desktop.screensaver user-switch-enabled for the unlock dialog when the session is locked. Having the lockdown setting not apply when the screen is locked is counterintuitive. This commit makes the unlock dialog honor both settings. Part-of: --- js/ui/unlockDialog.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 239e75ef5..370385abc 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -577,6 +577,10 @@ var UnlockDialog = GObject.registerClass({ this._userSwitchEnabledId = this._screenSaverSettings.connect('changed::user-switch-enabled', this._updateUserSwitchVisibility.bind(this)); + this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); + this._lockdownSettings.connect('changed::disable-user-switching', + this._updateUserSwitchVisibility.bind(this)); + this._userLoadedId = this._user.connect('notify::is-loaded', this._updateUserSwitchVisibility.bind(this)); @@ -858,7 +862,8 @@ var UnlockDialog = GObject.registerClass({ _updateUserSwitchVisibility() { this._otherUserButton.visible = this._userManager.can_switch() && - this._screenSaverSettings.get_boolean('user-switch-enabled'); + this._screenSaverSettings.get_boolean('user-switch-enabled') && + !this._lockdownSettings.get_boolean('disable-user-switching'); } cancel() {