gdm and keyboard layout switch

Bug #228196 reported by harrydg
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
X.Org X server
Confirmed
Unknown
gnome-control-center
Invalid
Unknown
xorg-server (Ubuntu)
Triaged
Low
Unassigned

Bug Description

first of all: what's the problem?:
i upgraded from ubuntu 7.10 to 8.04. i use 2 keyboard layouts (not in xorg.conf, that one just said: layout be and level3 right alt to switch): be and us
after upgrading, it didn't switch anymore, i just got "weird" chars (the switch seemed to switch to level3 for the entire keyboard). after playing with it (A LOT), i thougt: reinstall (and use xubuntu, since i only have 256MB of ram in the machine)
same problem there, BUT i found out WHERE the problem resides:
* install a ubuntu/xubuntu machine
* create multiple keyboard layouts in xorg.conf like:
Option "XkbLayout" "be,us(euro)"
or don't use the xorg way, but do it in the settings panel in gnome/xfce (like the first time i encountered the problem).
* all works fine... now lets break it!
* in your login settings window: enable autologin of a specific user
* reboot and watch how your keyboard switching applet messes up completely

i don't know exactly how that changes stuff, but i do know it took me a LONG time to find this one... can anyone tell me how/why this could happen? and where do i look to fix this? (this problem wasn't there in 7.10 and prior). this is a bitch to find, and hell to understand! ;)

if any info is needed: just yell ;)

Revision history for this message
Christian Betz (christian-betz) wrote :

I can confirm that I am affected by this same issue (using a Lenovo Thinkpad X60). I noticed it immediately because I have 'Make CapsLock an Additional Ctrl' enabled. This feature is a must on this laptop due to the strange location of the real Ctrl key.

I also upgraded from 7.10 to 8.04 and use GDM's automatic login feature. I noticed that I could only get the right keyboard settings after I either a) went into the keyboard settings dialog (which I assume refreshes the layout somehow) or b) logged out and the logged back in. This led me to believe something might be going on with the initialization of my gnome session by gdm or something similar. I ultimately wound up here :)

Of course everything works fine when automatic login is turned off. However, it is a nice feature to have.

I would also be happy to provide any info/logs needed.

Revision history for this message
TomasHnyk (sup) wrote :

I confirm it since it is also affecting me in the way already described. I cannot help more though:-(.

Revision history for this message
TomasHnyk (sup) wrote :

I assume this is a bug in gnome-keyboard-properties, which is in gnome-control-center package. It might also be a bug in GDM but I have no idea how to check that.

Changed in gnome-control-center:
status: Unknown → Confirmed
Changed in xorg-server:
status: Unknown → Confirmed
Revision history for this message
TomasHnyk (sup) wrote :

I googled a bit and found that is is actually a bug in xserver and that it is known upstream (see http://blogs.gnome.org/sudaltsov/2008/05/27/keyboard-is-not-configured-in-gnome-in-some-cases for acknowledgement from the developer of gnome-keyboard-config). I hope I got the links to other projects and bugs right. Anyway, it should be marked as triaged as it is an upstream issue.

James Westby (james-w)
Changed in gnome-control-center:
status: Confirmed → Triaged
Revision history for this message
TomasHnyk (sup) wrote :

Oh, and from the other bug report - there is a workaround. Run setxkbmap -print | xkbcomp - $DISPLAY and everything works as it should.
This does not work when I put it in session startup for some reason:-/. (i.e. it must be run manually)

Revision history for this message
Jan Vlnas (jnv) wrote :

See also bug #228196
Shouldn't we mark this as duplicate?

Revision history for this message
TomasHnyk (sup) wrote :

228196 is this bug, you must have messed up with copy and paste or something:-). Which bug did you mean?

Revision history for this message
Vit Svarc (vs-pb) wrote :

I can also confirm this strange behaviour, using Czech, German and US keyboard layout.
Sometimes it works ok, but sometimes no. I have also autologin enabled.

Revision history for this message
harrydg (harry-enzoverder) wrote : Re: [Bug 228196] Re: gdm and keyboard layout switch

is there any progress in this bug??? i see lots of people have it... any direction to a sollution?

ps. vit: it only works when you restart X after boot (normally ;))

* Vit Svarc <email address hidden>, 2008-07-28 22:45:37 Mon:
> I can also confirm this strange behaviour, using Czech, German and US keyboard layout.
> Sometimes it works ok, but sometimes no. I have also autologin enabled.

--
Rik Bobbaers

-- http://harry.enzoverder.be

Revision history for this message
ssergeje (ssergeje) wrote :

Hello!

I can confirm the issue mentioned in the first post on my compaq laptop (intel GMA945, i810 and intel drivers) and standalone box (nvidia GeForce2 IGP, nv driver) both running ubuntu 8.04.1:

1. Add 'Keyboard indicator' applet to your panel
2. Add second group (eg Spanish, or someother if your default is Spanish :-) )
3. Add laoyout switch shortcut (eg Alt+Shift)
4. You can now type using both your default and eg Spanish layouts. You can switch between the layouts using the shortcut or by clicking on the keyboard indicator applet
4. Enable GDM autologin
5. Reboot
6. Now you CAN'T switch the layout using the shortcut, only by clicking the applet. You can also swtich layouts by right-clicking the keyboard indicator applet and selecting a layout from the 'Group' option.
6.1 I have Estonian (default) and Russian phonetic layouts. Enabling the Russian layout doesn't work. The indicator changes, but the symbols I get by typing the keyboard are bizarre (looks like latin Serbian, not cyrillic Russian)

I did some tests to work thing out:
1. I disabled the GDM autologin and everything worked fine
2. I added two additional layouts. They worked too. See screenshot layoutSwitcher.png
3. I enabled the GDM autologin again. Switching didn't work. Moreover layouts nr 3 and 4 didn't turn on from the right-click option.
That is, double click only switches two first groups (Estonian and Russian). Two last are ignored (German, Spanish)
The right-click thing didn't work correct either:
right click the indicator -> Groups -> selecting option nr 3 (German) activates option nr 1 (Estonian), and selecting option nr 4 (Spanish) acivates option nr 2 (broken Russian that looks like Serbian)

BUT I also managed to fix the damn thing!
1. Right-click the keyboard indicator applet
2. Select 'Keyboard preferences'
3. Select 'Layouts' tab and click 'Reset to defaults'. Check that all the configs are gone
4. No you have to edit your xorg.conf file
I added these two lines to my keyboard section:
 Option "XkbLayout" "ee,ru(phonetic)"
 Option "XkbOptions" "grp:alt_shift_toggle"
5. Save the conf
6. Reboot. Voilá, the switching should work now with GDM autologin enabled. It works on my laptop and almost works on my box.
The keyboard indicator on the box only changes from Estonian to Russian on keyboard shortcut. It remains Estonian if you click on it, but it types cyrillic Russian, which is just fine for me :)

There's almost no difference in the Xorg.0.log when the GDM autologin is changed. I'm adding the logs and X server configs ass attachment (sorry for the zip)

Hope that helps!

Revision history for this message
ssergeje (ssergeje) wrote :
Revision history for this message
Gwyn (gwyn-rw) wrote :

I have the same problem with layout switching. But editing the xorg.conf file doesn't help.

I also seem to have problem like in the first post above with 'weird' characters.

This is what I did (Ubuntu 8.04, old Dell Inspiron 2500 laptop; auto login):

Added a keyboard indicator to panel.
Configured keyboard prefs - adding US and Fr layouts to the UK default.
Changed layout options to allow layout switching with Alt + Shift
Everything works fine until I shut down.
On restart, however, Alt + Shift does nothing.
I can switch layouts from UK to US by clicking on the panel icon (I have a UK laptop and use a plugin US keyboard), but when on US, I get gobbledegook when I type: ı æµ ŧ←þ→nŋ ł→ŧħ ↑§ ĸe←”øæ¶ð łæ←ø↓ŧ¡¡¡
Can't switch into FR at all.
Fiddling with the xorg.conf file doesn't seem to change things

Revision history for this message
ssergeje (ssergeje) wrote :

Hello Gwyn,
try to:
1. Right-click the keyboard indicator applet
2. Select 'Keyboard preferences'
3. Select 'Layouts' tab and click 'Reset to defaults'. Check that all the configs are gone
4. Log out/Log in (restart X)

Editting the xorg.conf didn't help me either, but resetting the defaults did the trick.
Please report if that helped. Cheers

Revision history for this message
Vit Svarc (vs-pb) wrote :

But the settings in xorg.conf is not any solution! What if every user wants to have different keyboard layouts?

Revision history for this message
Gwyn (gwyn-rw) wrote :

THe only solution that works for me is to disable automatic login. After
that no problems with layouts or layout switching at all.
Gwyn

2008/9/21 Vit Svarc <email address hidden>

> But the settings in xorg.conf is not any solution! What if every user
> wants to have different keyboard layouts?
>
> --
> gdm and keyboard layout switch
> https://bugs.launchpad.net/bugs/228196
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in gnome-control-center: Confirmed
> Status in X.Org X server: Confirmed
> Status in "gnome-control-center" source package in Ubuntu: Triaged
>
> Bug description:
> first of all: what's the problem?:
> i upgraded from ubuntu 7.10 to 8.04. i use 2 keyboard layouts (not in
> xorg.conf, that one just said: layout be and level3 right alt to switch): be
> and us
> after upgrading, it didn't switch anymore, i just got "weird" chars (the
> switch seemed to switch to level3 for the entire keyboard). after playing
> with it (A LOT), i thougt: reinstall (and use xubuntu, since i only have
> 256MB of ram in the machine)
> same problem there, BUT i found out WHERE the problem resides:
> * install a ubuntu/xubuntu machine
> * create multiple keyboard layouts in xorg.conf like:
> Option "XkbLayout" "be,us(euro)"
> or don't use the xorg way, but do it in the settings panel in gnome/xfce
> (like the first time i encountered the problem).
> * all works fine... now lets break it!
> * in your login settings window: enable autologin of a specific user
> * reboot and watch how your keyboard switching applet messes up completely
>
> i don't know exactly how that changes stuff, but i do know it took me a
> LONG time to find this one... can anyone tell me how/why this could happen?
> and where do i look to fix this? (this problem wasn't there in 7.10 and
> prior). this is a bitch to find, and hell to understand! ;)
>
> if any info is needed: just yell ;)
>

--
Gwyn Williams
6 Croydon Street
Karori
Wellington 6012
Ph. 970 6775

Revision history for this message
ssergeje (ssergeje) wrote :

This issue doesn't occur in Intrepid Alpha6 for me. As for LTS it's still broken unless the X conf is modified by hand or autologin is disabled. The solution is somewhere out there, but I couldn't find any in freedesktop or other's bugzillas.

Changed in gnome-control-center:
status: Confirmed → Invalid
Changed in gnome-control-center:
importance: Undecided → Low
Revision history for this message
Amos Shapira (amos-shapira) wrote :

Why is importance changed to "low"?

This is an annoying bug in an LTS version which is planned by many to be used for a few years from now.

It requires anyone who uses 8.04 with automatic login to unset and reset the configuration every time they boot the computer.

Many times automatic login is used to help computer-illiterates to use the computer without having to know about all the dials and knobs so a bug like this will affect such people even more so.

Revision history for this message
shaman (shaman-operamail) wrote :

A workaround can be found here: http://ubuntu.sabza.org/2006/10/13/xubuntu-easily-switch-keyboard-layout/. And for us Ubuntu 8.04 users, as follows:

Create a file in /usr/bin/

sudo gedit /usr/bin/fixkeyboard

Add following lines in this file. I am using US, DE and BG layouts. Also note that this example sets xkb option to change groups when Ctrl+Shift keys are pressed together.

#!/bin/bash
setxkbmap -option grp:switch,grp:ctrl_shift_toggle us,de,bg

Save the file and exit.
Change the permissions to root and make it executable:

sudo chmod 755 /usr/bin/fixkeyboard

Make the script be loaded every time you start the X-server: navigate to “System” menu, then choose “Preferences” and select “Sessions”. Then press button “Add”, type application name , command to start it (it’s /usr/bin/fixkeyboard) or add it by pressing "Add" button and chose from the list in /usr/bin/. Then press “Ok” and then “Close”. After next login to Gnome the script will start and you'll be able to switch layouts with keyboard.

That's all. I hope it helps.

Revision history for this message
Amos Shapira (amos-shapira) wrote :

Re: shaman - thanks!

I think my previous point is still valid - I'm ok with such a work-around, being a unix admin for over 20 years now, but:

1. I'd rather not have to do such stuff any more. I'm past the days that X11 with Athena Widgets and TWM and compiling X11 from source was part of a sysadmin's work. That's why I use Ubuntu on my desktop - so it can handle the desktop stuff while I get to break the really interesting stuff like automatic kickstart installation of tens of xen hosts :), but it might not be an option if I try to tell windows-lusers "just try ubuntu" and then things like that happen to them.

2. What's the meaning of "Long Term SUPPORT" if this bug has "low priority" and it feels like "fixed in intrepid" is an answer? It looks like many people are hit by this bug (it hit me a few weeks ago and only yesterday I learned that it is related to automatic login - guess how many people are hit that didn't even see this bug report?)

Cheers.

Revision history for this message
harrydg (harry-enzoverder) wrote :
Download full text (3.5 KiB)

I second that emotion... it took me quite a long time to figure out why
stuff wasn't working for me. My first sollution was to just disable
layouts and learn azerty again (can you imagine the horror ;))

from 7.04 to 7.10 i had hoped for a fix...
from 7.10 to 8.04 i had hoped for a fix, but since it didn't come, i
decided to look further about what happened, and so i created this report
from 8.04 to 8.10: still no fix and a change in importance to "low"

why is this so hard to fix? I don't know any xserver code, so i don't
really know where to look. (i have another problem with my logitech ultrax
r-rc6 remote, on which all keys with an "id" higher than 255 don't work
anymore since 7.10, which i don't seem to get answers from either (
http://lists.freedesktop.org/archives/xorg/2008-May/035433.html )

so... i indeed think that a lot of people encounter this bug, but just
give up (like i did)

greetings,

Harry dG

-- http://harry.enzoverder.be

> Re: shaman - thanks!
>
> I think my previous point is still valid - I'm ok with such a work-
> around, being a unix admin for over 20 years now, but:
>
> 1. I'd rather not have to do such stuff any more. I'm past the days that
> X11 with Athena Widgets and TWM and compiling X11 from source was part
> of a sysadmin's work. That's why I use Ubuntu on my desktop - so it can
> handle the desktop stuff while I get to break the really interesting
> stuff like automatic kickstart installation of tens of xen hosts :), but
> it might not be an option if I try to tell windows-lusers "just try
> ubuntu" and then things like that happen to them.
>
> 2. What's the meaning of "Long Term SUPPORT" if this bug has "low
> priority" and it feels like "fixed in intrepid" is an answer? It looks
> like many people are hit by this bug (it hit me a few weeks ago and only
> yesterday I learned that it is related to automatic login - guess how
> many people are hit that didn't even see this bug report?)
>
> Cheers.
>
> --
> gdm and keyboard layout switch
> https://bugs.launchpad.net/bugs/228196
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in gnome-control-center: Invalid
> Status in X.Org X server: Confirmed
> Status in “xorg-server” source package in Ubuntu: Triaged
>
> Bug description:
> first of all: what's the problem?:
> i upgraded from ubuntu 7.10 to 8.04. i use 2 keyboard layouts (not in
> xorg.conf, that one just said: layout be and level3 right alt to switch):
> be and us
> after upgrading, it didn't switch anymore, i just got "weird" chars (the
> switch seemed to switch to level3 for the entire keyboard). after playing
> with it (A LOT), i thougt: reinstall (and use xubuntu, since i only have
> 256MB of ram in the machine)
> same problem there, BUT i found out WHERE the problem resides:
> * install a ubuntu/xubuntu machine
> * create multiple keyboard layouts in xorg.conf like:
> Option "XkbLayout" "be,us(euro)"
> or don't use the xorg way, but do it in the settings panel in gnome/xfce
> (like the first time i encountered the problem).
> * all works fine... now lets break it!
> * in your login settings window: enable autologin of a specific user
> * reboot and w...

Read more...

Revision history for this message
Gwyn (gwyn-rw) wrote :
Download full text (6.0 KiB)

Hi,

I have just tried Shaman's solution above for Ubuntu 8.04. I created a
/usr/bin/fixkeyboard file with layouts for us, fr, gb. I enabled
automatic login. I can toggle between layouts (Alt + Shift), but a new
problem has arisen.

Now, when I open the control center or update manager or webbrowser or
any other application, the keyboard layout switches automatically to
French!!! When I close the application, the keyboard reverts to US
layout. I find this bizarre (and annoying)! I have a UK laptop, US
plug in keyboard and I occasionally type stuff in French.

So how do I change back to what I had before? Can I just delete the
/usr/bin/fixkeyboard file I created? Everything worked perfectly
before (toggling etc), but I just had to put in my password everytime
I started the computer.

Cheers,
Gwyn

2008/12/17 harrydg <email address hidden>:
> I second that emotion... it took me quite a long time to figure out why
> stuff wasn't working for me. My first sollution was to just disable
> layouts and learn azerty again (can you imagine the horror ;))
>
> from 7.04 to 7.10 i had hoped for a fix...
> from 7.10 to 8.04 i had hoped for a fix, but since it didn't come, i
> decided to look further about what happened, and so i created this report
> from 8.04 to 8.10: still no fix and a change in importance to "low"
>
> why is this so hard to fix? I don't know any xserver code, so i don't
> really know where to look. (i have another problem with my logitech ultrax
> r-rc6 remote, on which all keys with an "id" higher than 255 don't work
> anymore since 7.10, which i don't seem to get answers from either (
> http://lists.freedesktop.org/archives/xorg/2008-May/035433.html )
>
> so... i indeed think that a lot of people encounter this bug, but just
> give up (like i did)
>
> greetings,
>
> Harry dG
>
> -- http://harry.enzoverder.be
>
>> Re: shaman - thanks!
>>
>> I think my previous point is still valid - I'm ok with such a work-
>> around, being a unix admin for over 20 years now, but:
>>
>> 1. I'd rather not have to do such stuff any more. I'm past the days that
>> X11 with Athena Widgets and TWM and compiling X11 from source was part
>> of a sysadmin's work. That's why I use Ubuntu on my desktop - so it can
>> handle the desktop stuff while I get to break the really interesting
>> stuff like automatic kickstart installation of tens of xen hosts :), but
>> it might not be an option if I try to tell windows-lusers "just try
>> ubuntu" and then things like that happen to them.
>>
>> 2. What's the meaning of "Long Term SUPPORT" if this bug has "low
>> priority" and it feels like "fixed in intrepid" is an answer? It looks
>> like many people are hit by this bug (it hit me a few weeks ago and only
>> yesterday I learned that it is related to automatic login - guess how
>> many people are hit that didn't even see this bug report?)
>>
>> Cheers.
>>
>> --
>> gdm and keyboard layout switch
>> https://bugs.launchpad.net/bugs/228196
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>> Status in gnome-control-center: Invalid
>> Status in X.Org X server: Confirmed
>> Status in “xorg-server†source package in Ubuntu: Triaged
>...

Read more...

Revision history for this message
shaman (shaman-operamail) wrote :

Hi Gwyn,

That's really weird. You should try the option "Separate layout for each window" under the System->Preferences->Keyboard->Layouts checked/unchecked and/or try other keyboard models.

If the above doesn't fix your problem, you can simply disable the autostart of the fix:

Navigate to “System” menu, then choose “Preferences” and select “Sessions”. Under "Startup Programs" uncheck "fixkeyboard". Then press “Close”.

This will prevent the fix from autoloading and will restore your system to the previous state after the next restart.

Greetings

Revision history for this message
Gwyn (gwyn-rw) wrote :

Thanks!

2008/12/21 shaman <email address hidden>:
> Hi Gwyn,
>
> That's really weird. You should try the option "Separate layout for each
> window" under the System->Preferences->Keyboard->Layouts
> checked/unchecked and/or try other keyboard models.
>
> If the above doesn't fix your problem, you can simply disable the
> autostart of the fix:
>
> Navigate to "System" menu, then choose "Preferences" and select
> "Sessions". Under "Startup Programs" uncheck "fixkeyboard". Then press
> "Close".
>
> This will prevent the fix from autoloading and will restore your system
> to the previous state after the next restart.
>
> Greetings
>
> --
> gdm and keyboard layout switch
> https://bugs.launchpad.net/bugs/228196
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in gnome-control-center: Invalid
> Status in X.Org X server: Confirmed
> Status in "xorg-server" source package in Ubuntu: Triaged
>
> Bug description:
> first of all: what's the problem?:
> i upgraded from ubuntu 7.10 to 8.04. i use 2 keyboard layouts (not in xorg.conf, that one just said: layout be and level3 right alt to switch): be and us
> after upgrading, it didn't switch anymore, i just got "weird" chars (the switch seemed to switch to level3 for the entire keyboard). after playing with it (A LOT), i thougt: reinstall (and use xubuntu, since i only have 256MB of ram in the machine)
> same problem there, BUT i found out WHERE the problem resides:
> * install a ubuntu/xubuntu machine
> * create multiple keyboard layouts in xorg.conf like:
> Option "XkbLayout" "be,us(euro)"
> or don't use the xorg way, but do it in the settings panel in gnome/xfce (like the first time i encountered the problem).
> * all works fine... now lets break it!
> * in your login settings window: enable autologin of a specific user
> * reboot and watch how your keyboard switching applet messes up completely
>
> i don't know exactly how that changes stuff, but i do know it took me a LONG time to find this one... can anyone tell me how/why this could happen? and where do i look to fix this? (this problem wasn't there in 7.10 and prior). this is a bitch to find, and hell to understand! ;)
>
> if any info is needed: just yell ;)
>

Revision history for this message
Gwyn (gwyn-rw) wrote :

... Unchecking 'separate layout for each window' seems to have worked.

2008/12/22 Gwyn Williams <email address hidden>:
> Thanks!
>
> 2008/12/21 shaman <email address hidden>:
>> Hi Gwyn,
>>
>> That's really weird. You should try the option "Separate layout for each
>> window" under the System->Preferences->Keyboard->Layouts
>> checked/unchecked and/or try other keyboard models.
>>
>> If the above doesn't fix your problem, you can simply disable the
>> autostart of the fix:
>>
>> Navigate to "System" menu, then choose "Preferences" and select
>> "Sessions". Under "Startup Programs" uncheck "fixkeyboard". Then press
>> "Close".
>>
>> This will prevent the fix from autoloading and will restore your system
>> to the previous state after the next restart.
>>
>> Greetings
>>
>> --
>> gdm and keyboard layout switch
>> https://bugs.launchpad.net/bugs/228196
>> You received this bug notification because you are a direct subscriber
>> of the bug.
>>
>> Status in gnome-control-center: Invalid
>> Status in X.Org X server: Confirmed
>> Status in "xorg-server" source package in Ubuntu: Triaged
>>
>> Bug description:
>> first of all: what's the problem?:
>> i upgraded from ubuntu 7.10 to 8.04. i use 2 keyboard layouts (not in xorg.conf, that one just said: layout be and level3 right alt to switch): be and us
>> after upgrading, it didn't switch anymore, i just got "weird" chars (the switch seemed to switch to level3 for the entire keyboard). after playing with it (A LOT), i thougt: reinstall (and use xubuntu, since i only have 256MB of ram in the machine)
>> same problem there, BUT i found out WHERE the problem resides:
>> * install a ubuntu/xubuntu machine
>> * create multiple keyboard layouts in xorg.conf like:
>> Option "XkbLayout" "be,us(euro)"
>> or don't use the xorg way, but do it in the settings panel in gnome/xfce (like the first time i encountered the problem).
>> * all works fine... now lets break it!
>> * in your login settings window: enable autologin of a specific user
>> * reboot and watch how your keyboard switching applet messes up completely
>>
>> i don't know exactly how that changes stuff, but i do know it took me a LONG time to find this one... can anyone tell me how/why this could happen? and where do i look to fix this? (this problem wasn't there in 7.10 and prior). this is a bitch to find, and hell to understand! ;)
>>
>> if any info is needed: just yell ;)
>>
>

Revision history for this message
TomasHnyk (sup) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.