Bug #7065

Selected non-US keyboard layout is not applied

Added by matsa 2014-04-11 12:39:18 . Updated 2014-07-22 23:03:36 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Internationalization
Target version:
Start date:
2014-04-11
Due date:
% Done:

100%

Feature Branch:
bugfix/7065-keyboard-localization
Type of work:
Code
Blueprint:

Starter:
0
Affected tool:
Deliverable for:

Description

How to reproduce:

- build an ISO of tails-i386-devel-1.1-20140410
- boot and select french language

The keyboard layout is QWERTY.


Subtasks


Related issues

Related to Tails - Bug #7250: Bring back keyboard layout switch on presing Alt+Shift Resolved 2014-05-14
Related to Tails - Bug #7912: Non-US keyboard layout selected with Greeter sometimes is not active when logged in Resolved 2014-11-23

History

#1 Updated by intrigeri 2014-04-11 13:14:13

  • Subject changed from Wheezy: wrong keyboard layout to Selected French keyboard layout is not applied
  • Category set to Internationalization
  • Status changed from New to Confirmed
  • Target version set to Tails_1.1

I can reproduce that. In the GNOME keyboard layout prefs window, only the English (USA) layout is selected. After adding the French keyboard layout there, and enabling it in the applet that appears then in the panel, the right layout is set.

# cat /var/lib/gdm3/tails.locale 
TAILS_LOCALE_NAME=fr_FR
TAILS_XKBMODEL=pc105
TAILS_XKBLAYOUT=fr,us
TAILS_XKBVARIANT=,
TAILS_XKBOPTIONS=grp:alt_shift_toggle
# cat /etc/default/keyboard 
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="fr,us"
XKBVARIANT=","
XKBOPTIONS="grp:alt_shift_toggle"

BACKSPACE="guess"

I can find no other relevant trace of the “XKB” string in the Tails repo, nor in the greeter one, so likely we expect the GNOME session to configure the keyboard layout accordingly to /etc/default/keyboard.

My quick guess: either this file is not taken into account anymore, or the weird value to which XKBVARIANT is set breaks things somehow, or setting multiple layouts separated by commas in XKBLAYOUT is not supported anymore.

#2 Updated by intrigeri 2014-04-11 13:24:26

  • Assignee set to intrigeri
  • % Done changed from 0 to 10

intrigeri wrote:
> My quick guess: either this file is not taken into account anymore, or the weird value to which XKBVARIANT is set breaks things somehow, or setting multiple layouts separated by commas in XKBLAYOUT is not supported anymore.

It seems that the 2nd guess was correct, and this patch seems to fix things:

--- a/tailsgreeter/language.py
+++ b/tailsgreeter/language.py
@@ -273,7 +273,8 @@ class LocalisationSettings(object):
     def __apply_layout_to_upcoming_session(self):
         if self._layout != 'us':
             layout = '%s,us' % self._layout
-            variant = '%s,' % self._variant
+            if self._variant:
+                variant = '%s,' % self._variant
         else:
             layout = self._layout
             variant = self._variant

I’m going to test if our variant handling is more deeply broken or not, as it might be that this patch actually hides a deeper problem.

#3 Updated by intrigeri 2014-04-17 17:08:14

I’ve applied this patch in 0.7.28+wheezy3, and introduced another bug. Hopefully 0.7.29+wheezy1 fixes it.

#4 Updated by intrigeri 2014-04-17 17:21:50

  • Status changed from Confirmed to In Progress
  • % Done changed from 10 to 20

#5 Updated by intrigeri 2014-04-17 21:26:03

Still not fixed in 0.7.29+wheezy2. I think we’re missing to do something so that the chosen layout is actually applied to the GNOME session. Note that, with 0.7.29+wheezy2 at least, the chosen layout is applied within the Greeter.

#7 Updated by intrigeri 2014-05-03 20:30:12

alant wrote:
> https://wiki.gnome.org/ThreePointFive/Features/IBus might give hints

Right, even if it’s meant for GNOME 3.6+, so likely does not apply fully to Wheezy.

What I have tested:

  • With 0.7.30+wheezy1, when choosing French the first time, one gets a QWERTY layout. When killing gnome-session and choosing English this time, one gets the French layout eventually. When killing gnome-session again and choosing German this time, one gets a QWERTY layout.
  • gsettings set org.gnome.settings-daemon.plugins.keyboard active false: same behaviour
  • Not modify /etc/default/keyboard in PostLogin at all: the chosen keyboard layout is never applied, even on second login. So, this file is really used, somehow, to configure the keyboard. According to file:///usr/share/doc/xorg/howto/configure-input.html, X uses the properties from this file when it starts, if already exported by udev. Asking udev to reload this after X is started has no effect. So, it seems that the GNOME session is simply using the layout that was set when X started, that is either us (on first login) or the layout configured on the previous session (on subsequent login), that was saved by PostLogin to /etc/default/keyboard. In short: GNOME3 does not seem to use that file anymore: GDM3 has no way to set the keyboard layout, and GNOME3 relies on the first run wizard.
  • set /org/gnome/libgnomekbd/keyboard/{model,layout} in /etc/gdm3/PostLogin: tried with gsettings and dconf commands, fails since dbus autolaunch fails.

I’ll try to:

  • set /org/gnome/libgnomekbd/keyboard/{model,layout} ourselves, once the session is started
  • not set org/gnome/libgnomekbd/keyboard/options
  • revert the changes brought by the bugfix/allow-ibus-start branch

Once a solution is found, we may want to revert d8923b1 and/or fe99b843.

#8 Updated by intrigeri 2014-05-09 12:09:25

  • Description updated

#9 Updated by intrigeri 2014-05-09 15:24:34

  • Feature Branch set to bugfix/7065-keyboard-localization

#10 Updated by intrigeri 2014-05-09 15:36:15

  • Assignee changed from intrigeri to anonym
  • % Done changed from 20 to 50
  • QA Check set to Ready for QA

#11 Updated by intrigeri 2014-05-13 02:24:00

  • Subject changed from Selected French keyboard layout is not applied to Selected non-US keyboard layout is not applied

#12 Updated by anonym 2014-05-14 07:21:15

  • Assignee changed from anonym to intrigeri
  • % Done changed from 50 to 70
  • QA Check changed from Ready for QA to Dev Needed

Current state merged, but some more work is blocking 1.1, imho. See thread on tails-dev@.

#13 Updated by anonym 2014-05-20 04:32:48

  • Assignee deleted (intrigeri)
  • % Done changed from 70 to 80
  • QA Check changed from Dev Needed to Ready for QA

anonym wrote:
> Current state merged, but some more work is blocking 1.1, imho. See thread on tails-dev@.

This (to have ‘us’ layout on switch for non-us layouts) is now back again. A new tails-greeter has been built with this fix and uploaded to the feature branch’s APT suite.

#14 Updated by intrigeri 2014-05-26 05:48:49

  • Assignee set to intrigeri

I’ll take that one too.

#15 Updated by intrigeri 2014-05-26 06:13:28

  • Status changed from In Progress to Fix committed
  • Assignee deleted (intrigeri)
  • % Done changed from 80 to 100
  • QA Check changed from Ready for QA to Pass

#16 Updated by intrigeri 2014-05-26 06:13:37

  • related to Bug #7250: Bring back keyboard layout switch on presing Alt+Shift added

#17 Updated by BitingBird 2014-07-22 23:03:36

  • Status changed from Fix committed to Resolved

#18 Updated by intrigeri 2014-10-09 05:55:12

  • related to Bug #7912: Non-US keyboard layout selected with Greeter sometimes is not active when logged in added