diff options
| author | André Marçais <andre@marcais.net> | 2025-09-26 15:28:36 +0200 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2025-10-05 19:42:59 +0200 |
| commit | 56c5025e9584c673031519a9a6109cff0056b827 (patch) | |
| tree | 5f63d3065cc0434199e8ae1f8d0e5f2d91b056e2 /seat.c | |
| parent | c8a74c0c2de9fb257b1273ff6fbbbf7eb4e6a6da (diff) | |
Update layout indicator as soon as layout changes
Wait till after `xkb_state_update_mask` before rendering so that when
`render_frame` sees the changed keyboard layout state. (Otherwise the
layout indicator shows what the layout was before the modifier event.)
Diffstat (limited to 'seat.c')
| -rw-r--r-- | seat.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -92,14 +92,11 @@ static void keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard, int layout_same = xkb_state_layout_index_is_active(state->xkb.state, group, XKB_STATE_LAYOUT_EFFECTIVE); - if (!layout_same) { - damage_state(state); - } xkb_state_update_mask(state->xkb.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); int caps_lock = xkb_state_mod_name_is_active(state->xkb.state, XKB_MOD_NAME_CAPS, XKB_STATE_MODS_LOCKED); - if (caps_lock != state->xkb.caps_lock) { + if (caps_lock != state->xkb.caps_lock || !layout_same) { state->xkb.caps_lock = caps_lock; damage_state(state); } |
