After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657996 - First / only user account not selected by default; have to use mouse to login
First / only user account not selected by default; have to use mouse to login
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: login-screen
3.1.x
Other Linux
: Normal minor
: ---
Assigned To: Ray Strode [halfline]
gnome-shell-maint
triaged
: 660039 660054 660796 662282 686299 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-01 19:01 UTC by Adam Williamson
Modified: 2021-07-05 14:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdm: move focus to first item in list (1.56 KB, patch)
2011-10-17 06:58 UTC, Ray Strode [halfline]
committed Details | Review

Description Adam Williamson 2011-09-01 19:01:57 UTC
In the old GDM, the first or only user account would be highlighted on the login screen - so you could just hit 'enter', type the password, and be logged in.

In the new login screen, this isn't the case; hitting enter does nothing. You have to move the mouse to log in.

Perhaps the optimal behaviour would be, if there was only a single user account, to select it automatically and go straight to password entry; if there are multiple user accounts, highlight the first by default, so keyboard navigation can be used easily to select the desired account.

halfline says: "so there's two parts here, 1) initial focus is wrong 2) we don't queue key events if the user starts typing their password early"
Comment 1 Ray Strode [halfline] 2011-09-01 19:05:36 UTC
we'd have to know if network login was enabled or disabled before auto picking the user which might be hard (the whole Not Listed? button think i mean).

you should be able to just hit down arrow or tab or something to move focus, not use the mouse.

You're right, though, we really need select the correct one by default.
Comment 2 Matthias Clasen 2011-09-25 18:09:48 UTC
*** Bug 660039 has been marked as a duplicate of this bug. ***
Comment 3 Matthias Clasen 2011-09-25 18:10:45 UTC
*** Bug 660054 has been marked as a duplicate of this bug. ***
Comment 4 Ray Strode [halfline] 2011-10-03 15:35:26 UTC
*** Bug 660796 has been marked as a duplicate of this bug. ***
Comment 5 Jeremy Newton 2011-10-03 15:39:31 UTC
I haven't looked at the source myself, but I would assume there's an issue with putting the the "not listed?" below the password field?
Comment 6 Ray Strode [halfline] 2011-10-17 02:08:54 UTC
that's an idea, we could "Not Ray?" or whatever
Comment 7 Jeremy Newton 2011-10-17 02:53:09 UTC
Yeah it would make more sense to say that.

I figure the best way of implementation would be:
- if only one is available, auto-choose a user along with a "Not Whoever?" option
- if no user is available then it should right away show a field for a user name
- if there's multiple available users, the current implementation would be good.

For multiple users, it still would be a good idea to put the focus on the first user to avoid the misunderstanding that the user can't use the keyboard easily (like the misunderstanding of the OP)
Comment 8 Ray Strode [halfline] 2011-10-17 06:58:40 UTC
Created attachment 199175 [details] [review]
gdm: move focus to first item in list

This allows the user to just hit when the user
list first comes up (in many cases).
Comment 9 Ray Strode [halfline] 2011-10-17 23:57:06 UTC
( attachment 199175 [details] [review] isn't a complete fix, just a small incremental improvement to the current situation )
Comment 10 Jeremy Newton 2011-10-18 00:32:08 UTC
Assuming it can make it into 3.2.1, it's a good fix until 3.4.x
Comment 11 Jasper St. Pierre (not reading bugmail) 2011-10-18 00:46:31 UTC
Review of attachment 199175 [details] [review]:

IRC review.

::: js/gdm/loginDialog.js
@@ +310,3 @@
+
+    _moveFocusToItems: function() {
+        if (!this._hasItems()) {

let hasItems = Object.keys(this._items).length > 0;
if (!hasItems)
    return;
Comment 12 Ray Strode [halfline] 2011-10-18 00:47:21 UTC
had a brief discussion with Jasper over the patch on irc:

[19:49:42]  <halfline> magcius: can you review the interim patch i posted
for bug 657996 ? (since you've done so many other reviews for me today :-)
[19:49:43]  <bebot> Bug http://bugzilla.gnome.org/show_bug.cgi?id=657996
minor, Normal, ---, rstrode, UNCONFIRMED, First / only user account not
selected by default; have to use mouse to login
[19:49:49]  <magcius> halfline, sure.
[19:56:59]  <magcius> halfline, I'm confused -- you don't set can_focus on
this.actor, so why would it ever receive key focus?
[19:57:19]  <magcius> oh, because you do some setInitialKeyFocus
shenanigans
[19:57:43]  <halfline> right, it's a sort of dummy widget that holds focus
until an item is added
[19:58:07]  <halfline> but not a separate dummy widget, just reusing the
main widget itself
[19:58:29]  <magcius> Why not set the key focus when the first item is
added instead?
[19:59:03]  <halfline> i do
[19:59:07]  <halfline> that's the last hunk in the patch
[19:59:22]  <halfline> but i also do it any time focus is moved to the
dialog (say ctrl-alt-tab)
[20:00:40]  <magcius> halfline, the widget doesn't have can_focus set --
it shouldn't ever retrieve focus. no?
[20:02:39]  <halfline> magcius: hmm
[20:02:55]  <halfline> one sec
[20:02:56]  <magcius> unless the ModalDialog code is doing something silly
[20:07:40]  <halfline> magcius: yea that top line of the patch may be
completely bogus
[20:07:44]  <halfline> magcius: let me play a bit
[20:12:51]  <halfline> magcius: alright so the story is...
[20:13:35]  <halfline> can_focus is a shellism, and the focus can be moved
to a can_focus: false actor explicitly using clutter api
[20:13:46]  <halfline> instead of say the shell navigate_focus api
[20:13:58]  <halfline> and that is happening here
[20:14:07]  <halfline> we set initial focus to a can_focus: false widget
[20:14:15]  <halfline> which is a little questionable
[20:14:55]  <halfline> but it's the reason (apparently) why i added that
top line last night
[20:16:06]  <halfline> so if you want to say on the review that the
existing setInitialFocus to can_focus: false widget is wrong, i won't
argue with that
[20:18:06]  <magcius> We were already doing that.
[20:18:14]  <magcius> (but yes, it is wrong)
[20:19:19]  <magcius> halfline, so, does the top half do anything?
[20:19:41]  <halfline> yes, the key-focus-in signal is still emitted
[20:19:52]  <halfline> since key-focus-in is a clutter signal
[20:20:03]  <halfline> and clutter knows not of can_focus
[20:22:32]  <magcius> halfline, right, but when do we get the key-focus-in
signal?
[20:22:42]  <magcius> when does the element retrieve key focus?
[20:22:56]  <magcius> st_widget_navigate_focus won't give it....
[20:23:28]  <halfline> this.setInitialKeyFocus explicitly uses the clutter
function (set_key_focus or something like that)
[20:23:39]  <halfline> not right away, but later when the dialog is
getting opened
[20:24:02]  <magcius> which happens before the first item is added, right?
[20:24:09]  <magcius> so just focusing the first item explicitly should do
it, no?
[20:24:15]  <halfline> no
[20:24:54]  <halfline> not necessarly
[20:25:10]  <halfline> let me look through the code for a second then i'll
give you a more precise answer
[20:25:48]  <halfline> the _loadUserList function is called at LoginDialog
construction time
[20:26:05]  <halfline> if the user manager is already loaded then it will
populate the list immediately
[20:26:28]  <halfline> the dialog is opened shortly after its constructed
[20:27:05]  <halfline> loginDialog.connect('loaded', function() {
loginDialog.open() }); inside main.js
[20:27:31]  <halfline> magcius: so the the initial focus will potentially
get moved to the login dialog after the list is populated
[20:28:20]  <magcius> halfline, so the bottom half is doing nothing?
[20:28:22]  <halfline> if the user list isn't fully loaded yet though
[20:28:31]  <halfline> user manager
[20:28:42]  <halfline> then the open could happen before the user manager
loads
[20:29:17]  <halfline> so in any given boot, one half of that patch will
do nothing
[20:29:36]  <halfline> most boots the bottom half will do nothing
[20:30:40]  <magcius> halfline, OK. Only other thing: I'd rewrite
_hasItems as "Object.keys(this._items).length > 0" and move it inline.
[20:31:02]  <halfline> sure
[20:31:33]  <magcius> Other than that, go for it.
Comment 13 Ray Strode [halfline] 2011-10-18 00:47:38 UTC
(woops midair collision)
Comment 14 Ray Strode [halfline] 2011-10-18 00:49:27 UTC
Comment on attachment 199175 [details] [review]
gdm: move focus to first item in list

Attachment 199175 [details] pushed as 39d1235 - gdm: move focus to first item in list
Comment 15 Ray Strode [halfline] 2011-10-20 14:10:10 UTC
*** Bug 662282 has been marked as a duplicate of this bug. ***
Comment 16 Florian Müllner 2012-11-02 17:47:33 UTC
Is there anything left here?
Comment 17 Ray Strode [halfline] 2012-11-02 20:50:33 UTC
well we haven't done comment 5 yet
Comment 18 Bastien Nocera 2014-11-07 12:20:29 UTC
*** Bug 686299 has been marked as a duplicate of this bug. ***
Comment 19 Zaoliang Luo 2018-02-26 14:28:31 UTC
cc me
Comment 20 GNOME Infrastructure Team 2021-07-05 14:20:28 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.