Bug 240052

Summary: keyboard layout switches to american on login
Product: [Applications] systemsettings Reporter: Manuel Mommertz <2Kmm>
Component: kcm_keyboard_layoutAssignee: Andriy Rysin <arysin>
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: current kxkbrc
config for hal

Description Manuel Mommertz 2010-05-30 09:28:13 UTC
Version:           unspecified
OS:                Linux

I use a german keyboard layout. This was working until KDE SC 4.4 and is still working in kdm from 4.4.81. But if I login to plasma-desktop the layout is switched to american. I have no setting in kcmlocale and as said, it worked with all previous versions.

Reproducible: Always
Comment 1 Andriy Rysin 2010-05-31 19:16:03 UTC
could you please attach your kxkbrc file?
Comment 2 Manuel Mommertz 2010-06-01 09:32:23 UTC
Created attachment 47549 [details]
current kxkbrc

This is how it looks now, after trying to set the layout in systemsettings to german. But I did not found any direct setting for keyboard layout.
Comment 3 Andriy Rysin 2010-06-01 14:53:29 UTC
Hmm, so your configuration is supposed to set your KDE layout to "de" not sure why it would not work. BTW the keyboard layout configuration is in Regional&Languages in 4.4 but will be in Input Device/Keyboard in 4.5.
Comment 4 Manuel Mommertz 2010-06-02 12:45:47 UTC
Found it and forced to german. Now it works. But it should not switch the layout if deactivated. (It even showed the layout 'de' as only entry in the grayed list, before I activated 'configure layouts')
Comment 5 Andriy Rysin 2010-06-02 14:17:12 UTC
Apologies, the Use flag is set to false, so it should have been inactive. I am not sure why the layout was reset to us for you. I am curious if it can be some other software? How was your de layout set up before?
Comment 6 Manuel Mommertz 2010-06-02 18:23:05 UTC
It is set systemwide via hal policy. No other config was used before.
Comment 7 Andriy Rysin 2010-06-02 21:43:33 UTC
Could you please attach the config file which is responsible for this Hal policy?
Comment 8 Manuel Mommertz 2010-06-02 21:57:56 UTC
Created attachment 47619 [details]
config for hal

An of course lshal shows that it is configured correctly:

udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'
  info.addons.singleton = {'hald-addon-input'} (string list)
  info.callouts.add = {'hal-setup-keymap'} (string list)
  info.capabilities = {'input', 'input.keyboard', 'input.keypad', 'input.keys', 'input.keymap', 'button'} (string list)
  info.category = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  info.product = 'AT Translated Set 2 keyboard'  (string)
  info.subsystem = 'input'  (string)
  info.udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'  (string)
  input.device = '/dev/input/event4'  (string)
  input.keymap.data = {'e00b:switchvideomode', 'e016:wlan', 'e017:sleep', 'e018:suspend', 'e034:prog1'} (string list)
  input.originating_device = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port'  (string)
  input.product = 'AT Translated Set 2 keyboard'  (string)
  input.x11_driver = 'evdev'  (string)
  input.x11_options.XkbLayout = 'de'  (string)
  input.x11_options.XkbModel = 'evdev'  (string)
  input.x11_options.XkbOptions = {'compose:menu'} (string list)
  input.x11_options.XkbRules = 'xorg'  (string)
  input.x11_options.XkbVariant = 'nodeadkeys'  (string)
  input.xkb.layout = 'de'  (string)
  input.xkb.model = 'evdev'  (string)
  input.xkb.rules = 'xorg'  (string)
  input.xkb.variant = 'nodeadkeys'  (string)
  linux.device_file = '/dev/input/event4'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.sysfs_path = '/sys/devices/platform/i8042/serio0/input/input4/event4'  (string)
Comment 9 Manuel Mommertz 2010-06-03 15:08:41 UTC
I just looked at the source an tracked it down to this command, that is run on kde startup if I turn of layout switching:

setxkbmap -model evdev -option -option compose:menu

And indeed, if I run this by hand it switches my layout to us. But if I set the layout to de with setxkbmap and run the same command as above after that, the layout stays de. So maybe a bug in setxkbmap?
Comment 10 Manuel Mommertz 2010-06-03 15:29:30 UTC
Ok, the bug is already reported on fredesktop.org:

https://bugs.freedesktop.org/show_bug.cgi?id=24791

If I start a fresh session with xterm, german layout works, but setxkbmap -print show us-layout. And as soon as some option is changes via setxkbmap the (real) layout is switched to us.
Comment 11 Andriy Rysin 2010-06-04 05:47:44 UTC
Ahh, nice catch, I guess setting layouts with hal is somehow broken.
I just tried it here and if I set layout to "de" with "setxkbmap de" and then run "setxkbmap -model evdev -option -option compose:menu" it leaves "de" layout intact.

So shall we close this bug?
Comment 12 Manuel Mommertz 2010-06-04 09:23:53 UTC
It is not a KDE related bug, so yes I think this can be closed.