setxkbmap breaks keyboard layout switching on xwayland
Affected version
Arch Linux, GNOME Shell 40.1, Wayland only (XWayland, to be precise)
Bug summary
After running setxkbmap, keyboard layout switching doesn't work for windows running in XWayland mode. Native Wayland windows obey the shell keyboard layout.
Steps to reproduce
Run e.g.
setxkbmap -option caps:escape
Then try to change the keyboard layout with super+space. Native wayland windows, such as gnome-terminal work as expected, XWayland windows such as Firefox and Joplin in my case don't
What did you expect to happen
When I change the keyboard layout in GNOME Shell, I expect it to wipe out any modifications that might have been made using X-specific tools and resynchronize Wayland and XWayland windows to a shared keyboard handling.
xmodmap doesn't cause this issue.