diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2017-12-19 16:32:32 +0100 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2017-12-20 09:56:34 +0100 |
commit | 7f5f5eb8473649f19357b45baa925a1de8b8a683 (patch) | |
tree | c8abc8bd8f0af64bb00a0144a639095476b5b29d /src/wayland | |
parent | 44269e6a1dadb643af3a748c2bcca04ac1ab72eb (diff) | |
download | mutter-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/wayland')
-rw-r--r-- | src/wayland/meta-wayland-keyboard.c | 6 |
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); } |