On Thu Apr 9 12:46:09 2026 +0000, Rémi Bernon wrote:
I do see MappingNotify events, both on GNOME (Wayland) and KDE (X11 and Wayland). There are some variations between their behavior, some for instance reconfigure the keyboard every time the input method is changed, some only reconfigure the layout when switching between groups of 4-layouts. There are MappingNotify events when configuring the input methods as well. There is some weird thing going on GNOME Wayland that we might need to figure out (or we'll have to delay layout detection, or ignore the issue and consider it's a GNOME bug), and it is that I only see MappingNotify events *after* a KeyEvent has been received, which means that if no key is pressed and the layout is switched to a different set of 4 layout groups (this is how GNOME manages the layouts), we might incorrectly use the layouts that were initialized on startup. No idea why I'm not getting any MappingNotify event at all... I tried on Gnome X11 and Wayland, KDE X11, nothing. Some of that is in VMs but I don't see how that would make a difference. This is all with my own self-built Wine, usually with the new wow64 mode, but nothing particularly notable otherwise. I'm usually testing with my own small Windows test application, but same when using e.g. builtin notepad. Also tried to switch with the hotkeys vs with the mouse on the toolbar, no difference.
I'm attaching one of my logs, where I toggle the keyboard layout twice. This is with today's Wine, unchanged except I added a trace to `X11DRV_ProcessEvents()` for good measure... [log-notepad.txt.xz](/uploads/caff61076a7795736269345824dd0f7c/log-notepad.txt.xz) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10550#note_135698