On Thu Apr 9 15:13:56 2026 +0000, Rémi Bernon wrote:
How many layouts have you configured? What does `setxkbmap -print` says before/after you switch? Fwiw you can also check with `xev -event keyboard`, it should print the MappingNotify events whenever the Xkb descriptor changes, which happens for instance on GNOME, after you have pressed a key, iff you have more than 4 layouts configured, and when you switch from layout 0 to layout
= 4 for instance. Ahhh, yes, that was it. The keymap in use initially[*] covers multiple layouts and, depending on the specific transition, it could handle the new layout without switching the underlying keymap. For the records the log was taken with KDE while switching between "us" and "it" layouts (layout 0 and 1 respectively). If I switch to "ru" or "jp" (which are layouts 2 and 3) I get the MappingNotify event.
This brings up the "not noticing the layout switch until the next keypress" problem though. I don't know how important it is but it might be a point in favor of listening to Xkb events when available. [*] it's described like this: `xkb_symbols { include "pc+us+it:2+inet(evdev)" };` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10550#note_135704