Bug 466675 - keyboard layout not correctly detected
Summary: keyboard layout not correctly detected
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdm
Version: rawhide
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
Assignee: jmccann
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 467018 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-12 16:25 UTC by Horst H. von Brand
Modified: 2018-04-11 18:06 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-10-20 16:39:21 UTC
Type: ---
Embargoed:


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

Description Horst H. von Brand 2008-10-12 16:25:05 UTC
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 17:39:37 UTC
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 22:26:10 UTC
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-13 02:48:05 UTC
Created attachment 320160 [details]
xorg.conf

Comment 4 Horst H. von Brand 2008-10-13 02:49:37 UTC
Created attachment 320161 [details]
Xorg.0.log

Comment 5 Horst H. von Brand 2008-10-13 02:54:47 UTC
Moved xorg.conf out of the way, same result.

Comment 6 Horst H. von Brand 2008-10-13 02:55:42 UTC
Created attachment 320162 [details]
Xorg.0.log, no xorg.conf

Comment 7 Peter Hutterer 2008-10-13 03:16:15 UTC
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-13 03:55:17 UTC
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-13 03:59:28 UTC
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 04:03:08 UTC
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 04:30:30 UTC
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 08:46:00 UTC
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 16:38:42 UTC
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-14 00:53:40 UTC
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 11:54:14 UTC
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-15 00:36:00 UTC
(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 06:52:44 UTC
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 22:10:26 UTC
reassigning to gdm.

Comment 19 Horst H. von Brand 2008-10-16 01:08:46 UTC
(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-16 02:27:30 UTC
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-16 02:41:39 UTC
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-16 02:47:20 UTC
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-16 02:59:38 UTC
> 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-16 03:10:23 UTC
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 05:43:34 UTC
(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 07:53:41 UTC
*** Bug 467018 has been marked as a duplicate of this bug. ***

Comment 27 Horst H. von Brand 2008-10-16 14:23:00 UTC
(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 14:59:25 UTC
> 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 22:52:48 UTC
(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 06:20:32 UTC
Where does that leave the GDM keyboard setting though?

Comment 31 Matthias Clasen 2008-10-18 04:54:05 UTC
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 04:18:40 UTC
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 04:45:46 UTC
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 04:49:11 UTC
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 16:39:21 UTC
patch included in 2.24.0-11

Comment 36 Nicolas Chauvet (kwizart) 2008-10-22 17:13:18 UTC
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.