Modifier-only input switching with non-latin keyboard layouts has no effect under GNOME Shell

Bug #1318673 reported by William Hua
60
This bug affects 10 people
Affects Status Importance Assigned to Milestone
gnome-settings-daemon (Ubuntu)
Fix Released
High
William Hua
Trusty
Fix Released
High
Unassigned

Bug Description

[Impact]
In GNOME Shell, switching between latin and non-latin keyboard layouts using the XKB group options (e.g. ctrl+alt, alt+shift, etc.) doesn't work. This is a big usability problem for users that often need to switch layouts quickly, as using a typical shortcut with a non-modifier key is not appropriate for this function. See https://bugs.launchpad.net/gnome-settings-daemon/+bug/1218322 for impact.

This occurs because gnome-settings-daemon updates the XKB layouts when ISO_Next_Group is pressed, but then XKB immediately locks to the next group afterwards. The proposed fix is to have gnome-settings-daemon watch for XkbStateNotify changes on the lock mask, and lock the correct group when XKB changes it.

[Test case]
In GNOME Shell:
1. gnome-control-center > Keyboard > Shortcuts > Typing > Modifiers-only switch to next source. Choose a key combination like Ctrl+Shift.
2. gnome-control-center > Region & Language > Input Sources > + > Add a non-latin keyboard layout. I tested with English (US), Russian, and Arabic.
3. Tap the key combination. The indicator will switch between the two keyboard layouts, but typing will still be in the latin (English for me) layout.

The gnome-settings-daemon package from https://launchpad.net/~attente/+archive/java-non-latin-shortcuts includes the proposed fix for testing purposes. The merge proposal is here: https://code.launchpad.net/~attente/gnome-settings-daemon/1218322/+merge/219055.

[Regression potential]
gnome-settings-daemon is already handling most of the keyboard layout configuration at the user level and updating XKB to keep consistent with the user's settings. So doing the proposed fix should only make it more consistent. But it might prevent XKB's layout switching from working in contexts where gnome-settings-daemon wouldn't expect to run or work, like for example in a VT, or in a full-screen application that has an active grab on the keyboard.

Related branches

William Hua (attente)
tags: added: verification-needed
Changed in gnome-settings-daemon (Ubuntu):
assignee: nobody → William Hua (attente)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote :

The verification-needed tag is added by the SRU team when the upload is approved in the -proposed pocket.

tags: removed: verification-needed
Changed in gnome-settings-daemon (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello William, or anyone else affected,

Accepted gnome-settings-daemon into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/gnome-settings-daemon/3.8.6.1-0ubuntu11.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Alex Shtof (alex-shtf) wrote :
Revision history for this message
Alex Shtof (alex-shtf) wrote :

The trusty-proposed fix works for me. Thanks.

Revision history for this message
William Hua (attente) wrote :

Thanks Alex, I left a comment there asking others to use this bug for verification since ~ubuntu-sru is already subscribed here.

Revision history for this message
Alexander Anisimov (alenyashka) wrote :

Works for me too. Thanks.

But, I have "Use keyboard LED to show alternative layout" set to "Scroll Lock". After update when I switch to alternative layout led blink once and off, although it should light steadily.

Should I open another bug or it can be fix in this one?

Revision history for this message
William Hua (attente) wrote :

Thanks for testing Alexander, I think a separate bug would be best since I don't think it's worth stopping this SRU, unless something even more critical breaks.

Revision history for this message
Haggai Eran (haggai-eran) wrote :

The fix in ubuntu proposed didn't fix my issue. I was testing version 3.8.6.1-0ubuntu11.1. I tested with Caps Lock as the shortcut key, but I've also tried with Alt-Shift. I am able to change the keyboard layout once, and then it gets stuck in the second layout. The indicator didn't change at all during the test. Should this be a new bug, or do you think it is the same as #1244158?

Revision history for this message
John (vanuan) wrote :

It works, but for some reason gnome-setting-daemon is not started automatically at boot. I have to run it manually. Any suggestions to fix that?

Revision history for this message
Alexander Anisimov (alenyashka) wrote :

William, as you advised, I have opened new bug for LED indicator (https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1321085)

Revision history for this message
Alexander Anisimov (alenyashka) wrote :

I have tested it today in QtCreator and it doesn't work. The indicator switch to the Russian layout, but typing will still be in English.

In gedit, firefox, gnome-terminal it woks properly.

Revision history for this message
William Hua (attente) wrote :

Hi John, I'm not sure why g-s-d isn't starting for you, can you check your ~/.cache/upstart/gnome-settings-daemon.log files? I think that should be filed as a separate bug. Do you recall ever experiencing the problem before trying the package in trusty-proposed?

Haggai, I managed to replicate your issue a few times, but not with any reliable method. But for me, if I restart the session, the problem disappears; is it the case for you? It might be best to file a separate bug instead, because I don't believe this to be a regression, but a symptom of another problem...

Alexander, sorry, I tested it with Qt Creator as well, but unfortunately it didn't work before either. There's this bug already filed for it: https://bugs.launchpad.net/ubuntu/+source/ubuntu-touch-meta/+bug/1309844.

Revision history for this message
William Hua (attente) wrote :

I tested gnome-settings-daemon (3.8.6.1-0ubuntu11.1) from trusty-proposed, and the fix works for me. I'm marking this as verification-done. Please, if anyone has any severe regression, please do as Brian Murray explained above, add a comment here and change the tag to verification-failed.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Tjano (tjano) wrote :

This works for me too. Thank you, William!

Revision history for this message
Tjano (tjano) wrote :

There is a bug with screensaver (?), after some inactive time system does not lock screen and layout switcher brokes again :(

Revision history for this message
William Hua (attente) wrote :

Hi Tjano, does 'restart gnome-settings-daemon' fix the problem with the PPA? If not, maybe you can paste here the output of ~/.cache/upstart/gnome-settings-daemon.log. I can't seem to replicate that problem, but my guess is that it's unrelated to this SRU. If you can reliably replicate it, can you please file a new bug for it? Thanks!

Revision history for this message
Tjano (tjano) wrote :
Download full text (3.5 KiB)

I have same problem on my work and home PC both.

Log:

$ cat ~/.cache/upstart/gnome-settings-daemon.log
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:2318): GLib-CRITICAL **: Source ID 55 was not found when attempting to remove it
** (gnome-settings-daemon:5435): WARNING **: Name taken or bus went away - shutting down
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): wacom-plugin-CRITICAL **: gsd_wacom_device_get_device_type: assertion 'GSD_IS_WACOM_DEVICE (device)' failed
(gnome-settings-daemon:5435): GLib-CRITICAL **: Source ID 56 was not found when attempting to remove it
** (gnome-settings-daemon:7346): WARNING **: Name taken or bus went away - shutting down
** (gnome-settings-daemon:7351): WARNING **: Name taken or bus went away - shutting down
** (gnome-settings-daemon:7355): WARNING **: Name taken or bus went away - shutting down
** (gnome-settings-daemon:7359): WARNING **: Name taken or bus went away - shutting down
** (gnome-settings-daemon:7363): WARNING **: Name taken or bus went away - shutting down
** (gnome-settings-daemon:7367): WARNING **: Name taken or bus went away - shutting down
** (gnome-settings-daemon:7371): WARNING **: Name taken ...

Read more...

Revision history for this message
William Hua (attente) wrote :

Tjano, when it happens, can you please 'ps aux | grep settings-daemon'? It looks like you might have more than one g-s-d trying to run.

Revision history for this message
Tjano (tjano) wrote :

$ ps aux | grep settings-daemon
pparkho+ 7620 0.0 0.3 813568 12604 ? Ssl 16:39 0:00 /usr/lib/gnome-settings-daemon/gnome-settings-daemon
pparkho+ 8191 0.0 0.0 18392 948 pts/7 S+ 17:32 0:00 grep --color=auto settings-daemon

Log file (~/.cache/upstart/gnome-settings-daemon.log) is same, keyboard layouts seems not work correctrly. For example, when I trying to type something in gnome terminal, it starts to show latin letters, then I press "Ctrl+Shift", it changes layout to cyrillic, when I press Ctrl+Shift again, it not changes to latin. But if I change focus to another application and come back to terminal - it changes layout to latin back.

Sorry for my English, but, I hope, you understand me :)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-settings-daemon - 3.8.6.1-0ubuntu11.1

---------------
gnome-settings-daemon (3.8.6.1-0ubuntu11.1) trusty; urgency=medium

  * debian/patches/ubuntu-force-lock-group.patch:
    - Lock the XKB group when ISO_Next_Group is pressed (lp: #1318673)
 -- William Hua <email address hidden> Fri, 09 May 2014 14:37:33 -0400

Changed in gnome-settings-daemon (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of the Stable Release Update for gnome-settings-daemon has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-settings-daemon - 3.8.6.1-0ubuntu12

---------------
gnome-settings-daemon (3.8.6.1-0ubuntu12) utopic; urgency=medium

  * Drop all Unity patches and legacy features (LP: #1318539)
    - Keep schemas for background plugin, since they are used by u-s-d
  * debian/patches: Refreshed
    - git_new_screencast_keybinding.patch
    - git_xsettings_segfaults.patch
  * debian/control.in: Fix lintian warnings
    - gnome-settings-daemon-schemas add ${misc:Depends}
    - gnome-settings-daemon fix binNMUable error for gnome-settings-daemon-schemas
  * Bump standards to 3.9.5 (No changes)

gnome-settings-daemon (3.8.6.1-0ubuntu11.1) trusty; urgency=medium

  * debian/patches/ubuntu-force-lock-group.patch:
    - Lock the XKB group when ISO_Next_Group is pressed (lp: #1318673)
 -- Tim Lunn <email address hidden> Mon, 12 May 2014 10:06:51 +1000

Changed in gnome-settings-daemon (Ubuntu):
status: In Progress → Fix Released
Mathew Hodson (mhodson)
tags: added: keyboard-layout-switching-hotkeys
removed: grp input keyboard latin layouts non-latin non-modifier sources switching xkb
tags: added: gnome3
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.