Pointer confinement not working with subsurfaces
Affected version
- Fedora 35
- Gnome 41.5 running Wayland.
Bug summary
Pointer confinement is not working when the requested confinement region is attached to a subsurface. Reading the Wayland protocol spec, there is nothing there that prohibits this, and no protocol error is raised when attempting to do so.
Steps to reproduce
I've included a reproduction program to illustrate the issue. It creates a parent surface partially covered by a subsurface and has 4 modes that cycle by left-clicking anywhere in the window:
- Creates a confinement region on and encompassing the entire parent surface. Works as long as the pointer passes over the exposed parent surface not covered by the subsurface (correct).
- Creates a confinement region attached to and encompassing the entire subsurface. Nothing happens when the pointer enters the subsurface (incorrect).
- Creates a confinement region on the parent surface but positioned entirely behind the subsurface. Nothing happens when the pointer enters as the region is completely obstructed by the subsurface (correct).
- Creates a confinement region attached to and completely within the subsurface. Nothing happens when the pointer is in the subsurface and enters the region (incorrect).
What happened
Any attempt to confine the pointer to a region covered by a subsurface doesn't work.
Relevant logs, screenshots, screencasts etc.
Both the test program and the Wayland debug output when running it are attached below.
Edited by Frank Praznik