From 113bccef20bc133816ba011c12d598a55daff337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 7 Sep 2022 16:57:08 +0200 Subject: [PATCH] unlockDialog: Only show switch-user button for multiple users We don't offer "Switch user" on single-user systems when unlocked, so it is a bit weird to include it while locked. Part-of: (cherry picked from commit 756f212d6608ca281598b37033f114d1d5b0afe5) --- js/ui/unlockDialog.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 5edcfc53f..b5e62d982 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -579,8 +579,10 @@ var UnlockDialog = GObject.registerClass({ this._lockdownSettings.connect('changed::disable-user-switching', this._updateUserSwitchVisibility.bind(this)); - this._user.connectObject('notify::is-loaded', - this._updateUserSwitchVisibility.bind(this), this); + this._user.connectObject( + 'notify::is-loaded', () => this._updateUserSwitchVisibility(), + 'notify::has-multiple-users', () => this._updateUserSwitchVisibility(), + this); this._updateUserSwitchVisibility(); @@ -844,6 +846,7 @@ var UnlockDialog = GObject.registerClass({ _updateUserSwitchVisibility() { this._otherUserButton.visible = this._userManager.can_switch() && + this._userManager.has_multiple_users && this._screenSaverSettings.get_boolean('user-switch-enabled') && !this._lockdownSettings.get_boolean('disable-user-switching'); }