Wayland: Pointer constraint rectangle is incorrect for high-DPI windows
Affected version
- Mutter 41.3-1.fc35.x86_64
- Kernel 5.15.14-200.fc35.x86_64
- Both Mesa 21.3.4 and NVIDIA 495.46
Bug summary
When a Wayland fullscreen window has a high-DPI drawable surface, pointer confinement rectangles are smaller than they should be. For example, SDL_SetWindowMouseRect, which calls zwp_pointer_constraints_v1_confine_pointer, may set a rectangle of (60,0,1800,1080) on a window that is 1920x1080, and gnome-shell will confine the pointer to (roughly) the top left quadrant.
Steps to reproduce
This can be reproduced with the latest Git revision of ScummVM. On Fedora with a high-DPI display...
dnf builddep scummvm
git clone https://github.com/scummvm/scummvm
cd scummvm; ./configure; make
SDL_VIDEODRIVER=wayland ./scummvm
- Alt+Enter to toggle fullscreen
What happened
The mouse pointer is locked to the top left quadrant of the screen
What did you expect to happen
The mouse pointer should be confined to the drawn area of ScummVM's UI - the left/right pillarboxes should be inaccessible.