File gnome-shell-878951-hide-list-with-no-user.patch of Package gnome-shell.openSUSE_Leap_42.3_Update

diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 2f70c1f..642f9a2 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -730,6 +730,14 @@ const LoginDialog = new Lang.Class({
     _updateDisableUserList: function() {
         let disableUserList = this._settings.get_boolean(GdmUtil.DISABLE_USER_LIST_KEY);
 
+        // Disable user list when there are no users.
+        if (( disableUserList == false ) && ( this._userListLoaded == true )) {
+            let items = this._userList._items;
+            if ( Object.keys(items).length === 0 ) {
+                disableUserList = true;
+            }
+        }
+
         if (disableUserList != this._disableUserList) {
             this._disableUserList = disableUserList;
 
@@ -1232,14 +1240,18 @@ const LoginDialog = new Lang.Class({
             this._userList.addUser(users[i]);
         }
 
+        this._updateDisableUserList();
+
         this._userAddedId = this._userManager.connect('user-added',
                                                       Lang.bind(this, function(userManager, user) {
                                                           this._userList.addUser(user);
+                                                          this._updateDisableUserList();
                                                       }));
 
         this._userRemovedId = this._userManager.connect('user-removed',
                                                         Lang.bind(this, function(userManager, user) {
                                                             this._userList.removeUser(user);
+                                                            this._updateDisableUserList();
                                                         }));
 
         this._userChangedId = this._userManager.connect('user-changed',
openSUSE Build Service is sponsored by