Bug 1350

Summary: [XKB] Cannot switch between de_CH and us keyboards
Product: xorg Reporter: Silvio Böhler <sboehler>
Component: App/xkbcompAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high    
Version: 6.8.0   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Fixes the issue for fr_CH
none
Fixes the issue for fr_CH none

Description Silvio Böhler 2004-09-12 22:11:58 UTC
Gentoo Linux (The X.Org Foundation 6.7.0, revision r1-1.1.1)
60700000

Reproduce:

setxkbmap -layout "us,de_CH"

results in 

"Error loading new keyboard description"

However, I can successfully load both keymaps individually:
setxkbmap -layout "de_CH"
setxkbmap -layout "us"

I can successfully load other combinations of keymaps, e.g.

setxkbmap -layout "us,de"

No Swiss keymap seems to work in combination with the us layout.
Comment 1 Sergey V. Udaltsov 2004-09-29 17:05:18 UTC
Are you sure there is de_CH in the xkeyboard-config repository? Could you have a
look at the release 0.4?
Comment 2 Silvio Böhler 2004-12-08 17:26:45 UTC
Hello, sorry for not having answered more quickly. If I use the gnome keyboard
applet and try to add a Swiss German keyboard layout to the list, the following
message appears:

Error activating XKB configuration.
Probably internal X server problem.

X server version data:
Gentoo Linux (The X.Org Foundation 6.8.0, revision r3-0.2.2.1)
60800000

If you report this situation as a bug, please include:
- The result of xprop -root | grep XKB
- The result of gconftool-2 -R /desktop/gnome/peripherals/keyboard/xkb


The output of "xprop -root | grep XKB" is:

_XKB_RULES_NAMES_BACKUP(STRING) = "xorg", "pc102", "us", "", ""
_XKB_RULES_NAMES(STRING) = "xorg", "pc102", "us", "intl", "grp:alts_toggle"

The output of "gconftool-2 -R /desktop/gnome/peripherals/keyboard/xkb" is:

 layouts = [us  intl,de_CH]
 model = pc102
 overrideSettings = false
 options = [grp grp:alts_toggle]
 update_handlers = []


Other users reported the same problem elsewhere: e.g.
http://www.linuxquestions.org/questions/showthread.php?s=&forumid=2&threadid=184652

Comment 3 Silvio Böhler 2004-12-08 19:39:23 UTC
The problem is that for certain keyboard layouts, the corresponding symbols file
in /usr/lib/X11/xkb/symbols/pc/ is missing. Among these layouts are

az bs ca ca_enhanced de_CH fr_CH hu hu_qwerty lt_std mn vn hr_US

as mentioned in /usr/lib/X11/xkb/rules/xorg. These layouts are handled in a
special way in the xorg rules file, so the following works:

setxkbmap de_CH
setxkbmap fr_CH

etc. But the problem comes up when multiple layouts are defined, as for example in 

setxkbmap de_CH,en_US

This is the case if I want several keyboard layouts to be available. My usecase
is the following: I use an en_US layout for programming and a de_CH to write
texts, as the latter has all the accentuated characters needed in German and
French. 

One way to use this mechanism is to specify multiple layouts in the xorg.conf
file. Another one (what I want to do) is to use the keyboard indicator applet in
Gnome (2.6 or 2.8). Currently, for above reasons, this doesn't work.

For some reason this switching mode requires a file to be placed in the
/usr/lib/X11/xkb/symbols/pc/, and that's why it won't work with the "old" layouts. 

References: 
http://bugzilla.gnome.org/show_bug.cgi?id=145132
https://bugs.freedesktop.org/show_bug.cgi?id=1164
The same thing in Xfree86: http://bugs.xfree86.org/show_bug.cgi?id=1461
Comment 4 Silvio Böhler 2004-12-10 22:29:44 UTC
Created attachment 1512 [details]
Fixes the issue for fr_CH

Put this into /usr/lib/X11/xkb/symbols/pc in order to fix the issue and make
e.g. the Gnome keyboard layout switcher work for fr_CH (Swiss French). This has
been inspired by the file for the German layout (de).
Comment 5 Silvio Böhler 2004-12-10 22:34:12 UTC
Created attachment 1513 [details]
Fixes the issue for fr_CH

The previous file was for Swiss German, sorry for the mistake. This one here is
for Swiss French (fr_CH) and is based on the de_CH one, as the layouts are very
similar. Put it in /usr/lib/X11/kxb/symbols/pc as well.

Feel free to commit these files to x.org CVS. You might want to change the
/usr/lib/X11/kxb/rules/xorg file as well and remove de_CH and fr_CH from the
oldlayouts list.

Feel free to contact me for fixes, suggestions and other information, thanks!
Comment 6 Daniel Stone 2006-04-02 10:37:10 UTC
this is no longer an issue with xkeyboard-config

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.