sdl window partially catches mouse cursor

Host environment

  • Operating system: linux
  • OS/kernel version: Linux bookworm 6.1.0-16-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.67-1 (2023-12-12) x86_64 GNU/Linux
  • Architecture: x86_64
  • QEMU flavor: qemu-system-x86_64
  • QEMU version: 8.2.0
  • QEMU command line: kvm linux.img -display sdl

Emulated/Virtualized environment

  • Operating system: linux
  • OS/kernel version: Linux bookworm 6.1.0-16-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.67-1 (2023-12-12) x86_64 GNU/Linux
  • Architecture: x86_64

When SDL guest window is active on the host screen, it "catches" mouse cursor. After entering the guest window, keyboard/mouse grabbing is enabled. Once there, it is sometimes impossible to move mouse cursor out of guest window - the cursor does not pass either left&right or top&bottom guest window borders. This happens only after resizing guest window so that it is larger (either wider or higher) than guest display size, and clicking into the inside area of guest window. This does not happen if size of guest window is smaller.

At the very least, this is inconsistent with other display backends (eg gtk), and inconsistent with itself - we should either allow mouse cursor past any border, or none, but not "some" dependent on the size of guest display vs guest window.

I observed this behavior on a Gnome DE with wayland. It doesn't seem to be different if I use xwayland ($DISPLAY) or wayland ($WAYLAND_DISPLAY). Also, -vga qxl and -vga std, while a bit different, shows the same general behavior. Tried older versions, - it behaves the same up to v7.0.0.

Edited by Michael Tokarev
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information