Bug 14373

Summary: xkb: Alternative layouts don't work due to groups "invented" by the server
Product: xorg Reporter: Matthias B. <haferfrost>
Component: Server/Input/CoreAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: svu
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
i915 platform: i915 features:
Description Flags
0001-xkb-fix-core-keyboard-map-generation.-14373.patch none

Description Matthias B. 2008-02-04 14:04:08 UTC
The following configuration doesn't work with xorg-

Section "InputDevice"
    Identifier  "Keyboard"
    Driver      "kbd"
    Option      "AutoRepeat"    "250 30"

    Option "XkbModel" "pc105"
    Option "XkbLayout" "de,de(nodeadkeys)"
    Option "XkbOptions" "grp:caps_toggle"

When you press the "a" key, you get an "a" when switched to one group, but an "æ" when switched to the other group. Most other keys are broken, too. The reason is that for all keys where the 2 layouts have identical mappings and which therefore should contain only 1 group (xkbcomp optimizes away identical groups) the server "invents" a 2nd group that contains the last 2 symbols from group1.

Example: Here is the symbol mapping of the "a" key as reported by xkbcomp :0 - after starting the server with the above configuration.

key <AC01> {
 type[group1]= "FOUR_LEVEL_ALPHABETIC",
  symbols[Group1]= [  a,  A,  ae, AE ],
  symbols[Group2]= [  ae, AE ]

And here is how it should be

key <AC01> {
  symbols[Group1]= [  a,   A,  ae,   AE ]

And this is indeed what you get when you issue the command 

setxkbmap -layout "de,de(nodeadkeys)"

after the server has started. Why is this different? The 2 should be the same, shouldn't they?

Unfortunately, due to bug #14359, putting the setxkbmap command into .xinitrc can not be used as a workaround.
Comment 1 Peter Hutterer 2008-09-21 20:34:31 UTC
Created attachment 19077 [details] [review]

Patch sent to list for review.

Note that this patch most likely requires a follow-up patch to get rid of the duplicate groups again.
Comment 2 Peter Hutterer 2008-09-25 17:14:22 UTC
Pushed as ae986d1c73d2f720bd0309d8c33328d14e8eed25
Comment 3 Daniel Stone 2008-10-28 15:08:31 UTC
*** Bug 18277 has been marked as a duplicate of this bug. ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.