Bug 466675 - keyboard layout not correctly detected
keyboard layout not correctly detected
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gdm (Show other bugs)
rawhide
x86_64 Linux
medium Severity high
: ---
: ---
Assigned To: jmccann
Fedora Extras Quality Assurance
:
: 467018 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-12 12:25 EDT by Horst H. von Brand
Modified: 2018-04-11 14:06 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-10-20 12:39:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
xorg.conf (593 bytes, text/plain)
2008-10-12 22:48 EDT, Horst H. von Brand
no flags Details
Xorg.0.log (23.75 KB, text/plain)
2008-10-12 22:49 EDT, Horst H. von Brand
no flags Details
Xorg.0.log, no xorg.conf (81.81 KB, application/octet-stream)
2008-10-12 22:55 EDT, Horst H. von Brand
no flags Details
a patch (1.24 KB, patch)
2008-10-18 00:54 EDT, Matthias Clasen
no flags Details | Diff
another iteration (2.56 KB, patch)
2008-10-20 00:49 EDT, Matthias Clasen
no flags Details | Diff

  None (edit)
Description Horst H. von Brand 2008-10-12 12:25:05 EDT
Description of problem:
Again, my Spanish keyboard is English...

Version-Release number of selected component (if applicable):
xorg-x11-server-common-1.5.2-2.fc10.x86_64

How reproducible:
Always (I think, booted once since updating yesterday)


Steps to Reproduce:
1.
2.
3.
  
Actual results:
English layout

Expected results:
Spanish layout (as before)

Additional info:
Comment 1 Horst H. von Brand 2008-10-12 13:39:37 EDT
Sorry, it is not xorg-x11-server's fault at all. I reverted to the previous version, to no avail.
Comment 2 Matěj Cepl 2008-10-12 18:26:10 EDT
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.
Comment 3 Horst H. von Brand 2008-10-12 22:48:05 EDT
Created attachment 320160 [details]
xorg.conf
Comment 4 Horst H. von Brand 2008-10-12 22:49:37 EDT
Created attachment 320161 [details]
Xorg.0.log
Comment 5 Horst H. von Brand 2008-10-12 22:54:47 EDT
Moved xorg.conf out of the way, same result.
Comment 6 Horst H. von Brand 2008-10-12 22:55:42 EDT
Created attachment 320162 [details]
Xorg.0.log, no xorg.conf
Comment 7 Peter Hutterer 2008-10-12 23:16:15 EDT
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?
Comment 8 Horst H. von Brand 2008-10-12 23:55:17 EDT
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?
Comment 9 Horst H. von Brand 2008-10-12 23:59:28 EDT
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).
Comment 10 Peter Hutterer 2008-10-13 00:03:08 EDT
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.
Comment 11 antonio montagnani 2008-10-13 00:30:30 EDT
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???
Comment 12 Pierre Ossman 2008-10-13 04:46:00 EDT
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).
Comment 13 Horst H. von Brand 2008-10-13 12:38:42 EDT
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.
Comment 14 Peter Hutterer 2008-10-13 20:53:40 EDT
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.
Comment 15 Horst H. von Brand 2008-10-14 07:54:14 EDT
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.
Comment 16 Peter Hutterer 2008-10-14 20:36:00 EDT
(In reply to comment #15)
> Maybe I'm dense, but I can't find any place where such GDM settings are
> managed.

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.
Comment 17 Pierre Ossman 2008-10-15 02:52:44 EDT
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.
Comment 18 Peter Hutterer 2008-10-15 18:10:26 EDT
reassigning to gdm.
Comment 19 Horst H. von Brand 2008-10-15 21:08:46 EDT
(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
> now.

Sounds reasonable to me.
Comment 20 Matthias Clasen 2008-10-15 22:27:30 EDT
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.
Comment 21 Horst H. von Brand 2008-10-15 22:41:39 EDT
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?
Comment 22 Matthias Clasen 2008-10-15 22:47:20 EDT
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.
Comment 23 Matthias Clasen 2008-10-15 22:59:38 EDT
> 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 ?
Comment 24 Matthias Clasen 2008-10-15 23:10:23 EDT
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 ?
Comment 25 Pierre Ossman 2008-10-16 01:43:34 EDT
(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.
Comment 26 Peter Hutterer 2008-10-16 03:53:41 EDT
*** Bug 467018 has been marked as a duplicate of this bug. ***
Comment 27 Horst H. von Brand 2008-10-16 10:23:00 EDT
(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
Comment 28 Matthias Clasen 2008-10-16 10:59:25 EDT
> 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.

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...
Comment 29 Peter Hutterer 2008-10-16 18:52:48 EDT
(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?
Comment 30 Pierre Ossman 2008-10-17 02:20:32 EDT
Where does that leave the GDM keyboard setting though?
Comment 31 Matthias Clasen 2008-10-18 00:54:05 EDT
Created attachment 320737 [details]
a patch

Here is a patch that makes gdm pick up the layout from /etc/sysconfig/keyboard, instead of hardwiring "us".
Comment 32 Peter Hutterer 2008-10-20 00:18:40 EDT
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.
Comment 33 Matthias Clasen 2008-10-20 00:45:46 EDT
Might be theoretically better, but the patch would be a bit more involved, since the daemon doesn't have a display connection.
Comment 34 Matthias Clasen 2008-10-20 00:49:11 EDT
Created attachment 320840 [details]
another iteration

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.
Comment 35 Matthias Clasen 2008-10-20 12:39:21 EDT
patch included in 2.24.0-11
Comment 36 Nicolas Chauvet (kwizart) 2008-10-22 13:13:18 EDT
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)

Note You need to log in before you can comment on or make changes to this bug.