After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 511771 - Keyboard layout not set properly on logon
Keyboard layout not set properly on logon
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
2.21.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2008-01-24 12:26 UTC by Patryk Zawadzki
Modified: 2009-02-20 11:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Screenshot taken after logging in (347.94 KB, image/png)
2008-01-29 13:21 UTC, Patryk Zawadzki
  Details
a patch (815 bytes, patch)
2008-02-08 03:54 UTC, Matthias Clasen
accepted-commit_now Details | Review

Description Patryk Zawadzki 2008-01-24 12:26:55 UTC
Not sure if this is the correct module to file this bug. Feel free to reassign.

Whenever I login, my keyboard layout is reset to USA as confirmed by the keyboard layout applet even if the only layout in GNOME settings is "pl." If I switch the keyboard layout back and forth in GNOME settings, the correct layout comes back. Pretty annoying if you have to do it every time you log into the system.
Comment 1 Jens Granseuer 2008-01-25 17:23:48 UTC
Can you please post the content of the relevant GConf keys before and after login, and after changing the settings manually? (/desktop/gnome/peripherals/kbd/*)
Comment 2 Patryk Zawadzki 2008-01-26 19:46:52 UTC
One machine:

layout: [pl,us]
model: asus_laptop
options: [grp grp:shofts_toggle]
overrideSettings: false

Seems to work reliably.

Another machine:

layout: [pl]
model: dell101
options: [grp grp:shofts_toggle]
overrideSettings: true

Does not work and does not seem to change on login. I guess overrideSettings is the case and I sure did not set that bit manually (as it's marked as deprecated) and an educated guess would be at some time old GNOME noticed my Xorg config changed and asked me what to do thus setting this flag.
Comment 3 Patryk Zawadzki 2008-01-26 19:47:53 UTC
Excuse the typos, I'm in a remote location and had to retype this manually.
Comment 4 Jens Granseuer 2008-01-26 20:32:15 UTC
So, can you fix it by changing overrideSettings, then?
Comment 5 Patryk Zawadzki 2008-01-26 20:56:59 UTC
Will check that on Monday when I get to the office. If it helps it would make sense to drop or ignore that setting since there is no GUI to set it and it's marked as deprecated.
Comment 6 Patryk Zawadzki 2008-01-29 13:20:45 UTC
Upon further testing unchecking overrideSettings does not help. See attachment for a screenshot upon login (at this point keyboard is set to USA as indicated by the keyboard applet in the upper right corner) while settings seem to be ok in gconf.
Comment 7 Patryk Zawadzki 2008-01-29 13:21:22 UTC
Created attachment 103956 [details]
Screenshot taken after logging in
Comment 8 Jens Granseuer 2008-01-29 17:13:08 UTC
Sergey, can you please take a look?
Comment 9 Sergey V. Udaltsov 2008-01-30 21:04:04 UTC
1. Just out of curiosity - what is the configuration in /etc/X11/xorg.conf?

2. When you run "setxkbmap -layout pl -model dell101" - does it work ok?

3. What is the version of xkeyboard-config you are using?

I tried to setup your configuration on my machine - it seems to work ok :(( Jens, can you reproduce it?
Comment 10 Patryk Zawadzki 2008-01-30 21:17:04 UTC
There is no xorg.conf part related to keyboard, only the graphics driver. This shouldn't really matter if there is a way to override it in GNOME. BTW, evdev is not installed.

Yup, setxkbmap correctly sets the pl layout instead of the us one.

[patrys@purrr ~]$ rpm -q xkeyboard-config
xkeyboard-config-1.1-5.noarch
Comment 11 Jens Granseuer 2008-01-30 21:31:41 UTC
(In reply to comment #9)
> Jens, can you reproduce it?

No, I can't.
Comment 12 Patryk Zawadzki 2008-01-30 21:58:53 UTC
Any idea what chenged between 2.20 and 2.21 so I can start digging on my own?
Comment 13 Pawel Worach 2008-01-30 22:01:57 UTC
Here is how the problem looks for me.
In xorg.conf I have:
Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbLayout" "se"
        Option      "XkbModel" "thinkpad"
EndSection

In the "Layouts" tab the default is taken from Xorg I guess because it lists
"Sweden". Now If I add "Poland/default" or "Sweden/svdvorak" I can switch
between the layouts without any problem in the current session. If I however
restart the gnome session only "Sweden" is listed in the panel applet "Groups",
however the other layout is still present in the "Layouts" tab, to make
switching working again I have to remove the other layouts and add them back.

Using xkeyboard-config-1.0_2 on FreeBSD 8-CURRENT.
Comment 14 Sergey V. Udaltsov 2008-01-31 00:25:35 UTC
(In reply to comment #12)
> Any idea what chenged between 2.20 and 2.21 so I can start digging on my own?
> 
Not much. The most substantial change was handling of the descriptions and translations - they are not negotiated over dbus any more.

I am going to upgrade to Hardy soon - and will try to reproduce your problem again...
Comment 15 Sebastien Bacher 2008-02-04 21:30:56 UTC
There is a similar ubuntu bug on http://bugzilla.gnome.org/show_bug.cgi?id=511771
Comment 16 Patryk Zawadzki 2008-02-04 22:54:25 UTC
Sebastien:

Check your link. Now this bug is not only curious but also recursive ;)
Comment 17 Matthias Clasen 2008-02-07 17:02:50 UTC
Here is a Fedora bug that mentions the same issue:

https://bugzilla.redhat.com/show_bug.cgi?id=428901
Comment 18 Matthias Clasen 2008-02-08 03:54:06 UTC
Created attachment 104683 [details] [review]
a patch

the new settings daemon still has the gsd_keyboard_xkb_load() function, but it is no longer called...
Comment 19 Jens Granseuer 2008-02-08 08:41:29 UTC
That sounds like a good reason... Please commit.
Comment 20 Yar Tikhiy 2008-02-08 08:52:57 UTC
BTW, this bug might be related to bug 483182.
Comment 21 Andrew Conkling 2008-02-08 10:39:52 UTC
(In reply to comment #9)
> 2. When you run "setxkbmap -layout pl -model dell101" - does it work ok?

Not sure if this was supposed to fix it, but this kinda sorta worked for me. (In my case, it's between USA and USA/Dvorak, the latter of which should be the default layout.)

After running `setxkbmap -layout dvorak -model dell101`, my Keyboard Indicator applet shows "dvorak" (it usually shows "USA", or "USA2"--that 2 should be a subscript, but my Compose key, also set through the Keyboard settings, is also not working :). My keyboard layout is now working correctly.

However, "Groups" under the context menu for the applet shows a blank submenu, so I cannot switch between the layouts like I normally can.

Maybe all of this is obsoleted by Matthias' patch, but I just thought I'd make note. :)
Comment 22 Matthias Clasen 2008-02-08 13:35:42 UTC
2008-02-08  Matthias Clasen  <mclasen@redhat.com>

        * plugins/keyboard/gsd-keyboard-manager.c
        (gsd_keyboard_manager_start): Load the XKB settings initially.
        Fixes bug #511771.

Comment 23 Sergey V. Udaltsov 2008-02-09 17:24:51 UTC
Thanks Matthias

I should have spotted it - I just did not have a chance to look at new g-s-d closely...
Comment 24 Josh Schmidt 2008-06-07 03:00:57 UTC
I am experiencing this bug and am using Ubuntu 8.04 with gnome 2.22.2 (After the patch was applied).

I noticed the changes that were made to the file at http://svn.gnome.org/viewvc/gnome-settings-daemon/trunk/plugins/keyboard/gsd-keyboard-manager.c?r1=267&view=log were undone in revision 267. Did this bug get unintentionally reintroduced?

There may be a number of bugs currently being reported that have assumed this was fixed. Here are a few:
http://bugzilla.gnome.org/show_bug.cgi?id=483182
https://bugs.launchpad.net/gnome-control-center/+bug/173721