XWayland: rootfull, lost keyboard focus after hiding the cursor
Sway has an option to automatically hide the mouse cursor after a timeout or when typing on the keyboard. I noticed that when using XWayland in rootfull mode, the underlying X11 client is losing focus every time the mouse becomes hidden. The mouse must be moved to get the focus back.
Native wayland clients and XWayland clients in rootless mode do not have this behavior. Xephyr (running via Xwayland) is not affected either.
System information:
- XWayland 23.2.2-1
- Sway 1.8.1
- Debian Testing (trixie)
Steps to reproduce:
- Start Sway or a compositor with the ability to hide the cursor. In Sway, a 5s timeout can be set with
swaymsg "seat * hide_cursor 5000"
- Start a terminal in XWayland in rootfull mode
export DISPLAY=:20 ; Xwayland $DISPLAY -geometry 1200x800 & sleep 1 ; xterm
- Move the mouse cursor to give focus to the terminal in the rootfull XWayland window.
- Wait for 5s until the mouse cursor disappears.
- Start typing. Nothing happens.
- Move the mouse to bring the cursor back. The keyboard should be functional again.
Expected behavior: The keyboard should remain functional when the mouse cursor is hidden.