summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2017-12-19 16:32:32 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2017-12-20 09:56:34 +0100
commit7f5f5eb8473649f19357b45baa925a1de8b8a683 (patch)
treec8abc8bd8f0af64bb00a0144a639095476b5b29d /src
parent44269e6a1dadb643af3a748c2bcca04ac1ab72eb (diff)
downloadmutter-7f5f5eb8473649f19357b45baa925a1de8b8a683.tar.gz
wayland/keyboard: preserve layout index
On VT switch, the xkb state layout index is lost and reset to the first group, so if the first layout is not the last one being used, the xkb state used in both meta-wayland-keyboard.c and clutter/evdev will be desynchronized with the keyboard source indicator in the gnome-shell UI. Save the effective layout chosen along with the seat so it can be restored when reclaiming devices. Use the saved layout index from the clutter/evdev's seat to restore the layout in meta-wayland-keyboard, so that switching VT doesn't reset the layout and causes further discrepancies with the layout indicator in the gnome-shell UI. https://bugzilla.gnome.org/show_bug.cgi?id=791383
Diffstat (limited to 'src')
-rw-r--r--src/wayland/meta-wayland-keyboard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index c069df887..5b90b2a7a 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -508,6 +508,8 @@ meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard)
{
MetaWaylandXkbInfo *xkb_info = &keyboard->xkb_info;
xkb_mod_mask_t latched, locked;
+ MetaBackend *backend = meta_get_backend ();
+ xkb_layout_index_t layout_idx;
/* Preserve latched/locked modifiers state */
if (xkb_info->state)
@@ -523,8 +525,8 @@ meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard)
xkb_info->state = xkb_state_new (xkb_info->keymap);
- if (latched || locked)
- xkb_state_update_mask (xkb_info->state, 0, latched, locked, 0, 0, 0);
+ layout_idx = meta_backend_get_keymap_layout_group (backend);
+ xkb_state_update_mask (xkb_info->state, 0, latched, locked, 0, 0, layout_idx);
kbd_a11y_apply_mask (keyboard);
}