From 56c5025e9584c673031519a9a6109cff0056b827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mar=C3=A7ais?= Date: Fri, 26 Sep 2025 15:28:36 +0200 Subject: 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.) --- seat.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'seat.c') diff --git a/seat.c b/seat.c index eb837b3..c47c192 100644 --- a/seat.c +++ b/seat.c @@ -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); } -- cgit v1.2.3