Red Hat Bugzilla – Bug 466675
keyboard layout not correctly detected
Last modified: 2018-04-11 14:06:31 EDT
Description of problem:
Again, my Spanish keyboard is English...
Version-Release number of selected component (if applicable):
Always (I think, booted once since updating yesterday)
Steps to Reproduce:
Spanish layout (as before)
Sorry, it is not xorg-x11-server's fault at all. I reverted to the previous version, to no avail.
Thanks for the bug report. We have reviewed the information you have provided above, and there is some additional information we require that will be helpful in our diagnosis of this issue.
Please attach your X server config file (/etc/X11/xorg.conf) and X server log file (/var/log/Xorg.*.log) to the bug report as individual uncompressed file attachments using the bugzilla file attachment link below.
Could you please also try to run without any /etc/X11/xorg.conf whatsoever and let X11 autodetect your display and video card? Attach to this bug /var/log/Xorg.0.log from this attempt as well, please.
We will review this issue again once you've had a chance to attach this information.
Thanks in advance.
Created attachment 320160 [details]
Created attachment 320161 [details]
Moved xorg.conf out of the way, same result.
Created attachment 320162 [details]
Xorg.0.log, no xorg.conf
the log indicates that the keyboard layout loaded is "es". are you sure you don't just override this with whatever gnome/kde/etc. sets?
I tried to override it in Gnome settings (Latin American layout), no dice.
And I wouldn't override it wrong by hand, would I?
What can I do to check if Gnome screwed it up?
Weird... just went again into the Gnome menu: System -> Preferences -> Hardware -> Keyboard -> Layout and told it to reset to defaults, now it works (Shows Spain).
Before I had tried to set it to Spain by hand, and it didn't work (USA was listed as the default).
If you add the keyboard-indicator applet, what does it say?
- if it doesn't say Spanish, then it's probably gnome
Can you change the keyboard layout using "setxkbmap -layout es"?
- if you can't do that, it's probably the server.
Try running "setxkbmap -print -layout es > setxkbmap.out", and then run xkbcomp setxkbmap.out :0.
- if xkbcomp fails, it's xkeyboard-config.
same here...I added the Italian option and it worked...466675.
But on one of my system I don't have tha keyboard indicator applet!!! why???
As I stated on bug 434669, nuking Gnome's kbd gconf settings gets the right layout instantly. It does reset it to "us" on each reboot though (probably on each login, but I haven't tested it that thoroughly).
Same here: On reboot, the layout is USA, Gnome settings asking for Default gives Spain (and then it works).
After the above, the keyboard-indicator applet shows Esp.
Do you have US set as language in GDM? This would overwrite your gnome setting on login, and you always end up with the language that was chosen in gdm.
Maybe I'm dense, but I can't find any place where such GDM settings are managed.
In any case, keying keyboard layout off the language is complete nonsense: I prefer handling the system in English, but my keyboard is Spanish (and I do need to write Spanish texts quite often). I've had machines with English keyboards, and even used German keyboards. How about the misguided souls who prefer Dvorak?
Yes, I have LANG=en_US.utf8. No, I won't change this.
In any case: Loged in again, keyboard-indicator shows USA. Via System -> Preferences -> Harware -> Keyboard -> Layout, need to set Defaults again to get Spain (not USA), and clicking on that I get the keyboard right.
(In reply to comment #15)
> Maybe I'm dense, but I can't find any place where such GDM settings are
don't know where the settings are stored, but If I click on my login name (or "other") at the bottom of the screen there's a selection box for language and one for keyboard. can you find that?
> In any case, keying keyboard layout off the language is complete nonsense: I
> prefer handling the system in English, but my keyboard is Spanish (and I do
> need to write Spanish texts quite often).
sorry, wasn't clear in the previous comment. language and layout are separate of course. and layout is what counts here.
I've done a bit more testing, and concluded the following:
- If there is no gconf setting, Gnome will use what is reported by Xorg
- If there is no gconf setting _at login_, Gnome will set what is reported by GDM
- GDM ignores Xorg, HAL and /etc/sysconfig/keyboard and defaults to "us"
The end result is, yes I get the keyboard layout selected in GDM. But only if I've never chosen one before! I.e. if I log in without noticing the keyboard selection (which only becomes visible once it is time to enter the password), I get "us" permanently, even if I select something else in GDM the next time. If I remove the gconf key, then I can select the keyboard in GDM again.
I'd like to propose the following changes:
- If there is no gconf setting, Gnome will use what is reported by GDM, or X11 (as available, in that order)
- Gnome will never store anything in gconf based on GDM selection. Only explicit configuration using the keyboard preferences changes gconf values. (how else would you choose "use system default", something that is useful if you move between several machines with different layouts)
- GDM respects the keyboard layout as reported by Xorg
- Better UI for GDM. It's waaaay to easy to miss the keyboard selection right now.
reassigning to gdm.
(In reply to comment #17)
> I've done a bit more testing, and concluded the following:
> I'd like to propose the following changes:
> - If there is no gconf setting, Gnome will use what is reported by GDM, or X11
> (as available, in that order)
> - Gnome will never store anything in gconf based on GDM selection. Only
> explicit configuration using the keyboard preferences changes gconf values.
> (how else would you choose "use system default", something that is useful if
> you move between several machines with different layouts)
> - GDM respects the keyboard layout as reported by Xorg
> - Better UI for GDM. It's waaaay to easy to miss the keyboard selection right
Sounds reasonable to me.
It is impossible to make everybody happy here.
The current behaviour was arrived at because people (who ignore the keyboard selector on the login screen) complained that the gdm layout (us) was overriding their explicitly configured layout.
It is completely broken! This machine has _never_ had anything but an Es keyboard, and suddenly I have to reconfigure the keyboard each time I log in?
One possible improvement would be to only pull the gdm layout into the session if the user has explicitly selected a layout on the login screen, preventing the 'oops, I missed the keyboard selector the first time, and now 'US' is in my configuration' gotcha.
But we currently don't have the information in gdm if the user made a selection or not.
> It is completely broken! This machine has _never_ had anything but an Es
> keyboard, and suddenly I have to reconfigure the keyboard each time I log in?
No. You should only have to configure it once.
Why would you have to do it each time ?
Just to clarify this: gdm is supposed to store your selections from the login screen (session, language, layout) in ~/.dmrc, and present the same choices the next time you log in as the same user. Is that not working for you ?
(In reply to comment #20)
> It is impossible to make everybody happy here.
> The current behaviour was arrived at because people (who ignore the keyboard
> selector on the login screen) complained that the gdm layout (us) was
> overriding their explicitly configured layout.
That behaviour can stay. The problem is that a) something stores it in gconf, making it a permanent setting, and b) GDM has "us" as default, not what Xorg reports.
*** Bug 467018 has been marked as a duplicate of this bug. ***
(In reply to comment #23)
> > It is completely broken! This machine has _never_ had anything but an Es
> > keyboard, and suddenly I have to reconfigure the keyboard each time I log in?
> No. You should only have to configure it once.
> Why would you have to do it each time ?
Because the GDM settings are "invisible" (just noticed them after somebody here mentioned that they exist), and I had to set it again inside Gnome each time. I set it in GDM this time, hope the setting lasts...
At least, the default setting should be whatever the keyboard reports
> The problem is that a) something stores it in gconf,
> making it a permanent setting, and b) GDM has "us" as default, not what Xorg
There's no way to avoid storing it in gconf, otherwise you don't see the current configuration in the keyboard capplet.
> At least, the default setting should be whatever the keyboard reports
Keyboards don't report anything. Thats a big part of the problem...
(In reply to comment #28)
> Keyboards don't report anything. Thats a big part of the problem...
If you have your language set in /etc/sysconfig/keyboard, X will set the layout on startup. Including the _XKB_RULES_NAMES property which I believe the keyboard applet uses to indicate the language anyway.
If you only write the gconf settings when the user has clicked on gdm/gnome-keyboard-properties, and you only update the layout when gconf settings are present, then that should fix the issues?
Where does that leave the GDM keyboard setting though?
Created attachment 320737 [details]
Here is a patch that makes gdm pick up the layout from /etc/sysconfig/keyboard, instead of hardwiring "us".
wouldn't it be better to get the _XKB_RULES_NAMES property?
Theoretically, a user can have a fdi file that specifies a different keytable than what is in /e/s/k.
Mind you, this may be a marginal use case. Furthermore, the property doesn't work for multiple different layouts on keyboards either, so I'm not sure myself if that is worth pursuing.
Might be theoretically better, but the patch would be a bit more involved, since the daemon doesn't have a display connection.
Created attachment 320840 [details]
This version of the patch also avoids setting the GDM_KEYBOARD_LAYOUT envvar when the selected layout is the same as the system default.
This avoids the situation where the user overlooks the keyboard selector on first login and has the system default layout stored in his gconf configuration.
patch included in 2.24.0-11
works with me.
But I've also set:
echo fr-latin9 > /etc/X11/Xkbmap
in %post while creating my own french LiveCD.
(was required previously with F-9)