SUMMARY On a Wayland session a native Wayland client created with pointer constraints and server side decoration will no longer constrain the pointer if the client dynamically switches to client side decoration whilst the pointer is constrained. STEPS TO REPRODUCE 1. Create a simple Wayland client that uses xdg-shell, pointer-constraints and xdg-decoration protocols. 2. Create an xdg_toplevel 3. Request SSD for the xdg_toplevel using zxdg_toplevel_decoration_v1_set_mode 4. Constrain the pointer to the wl_surface associated with the xdg_toplevel using zwp_pointer_constraints_v1_confine_pointer 5. Request CSD 6. Move the pointer outside the surface along the top edge OBSERVED RESULT The title bar is removed however the pointer is no longer contained by the top edge of the surface (where the title bar used to be), however the other 3 edges do still constrain the pointer. EXPECTED RESULT All four edges should still constrain the pointer. LIST OF SCENARIOS SSD -> Constrain Pointer -> CSD -> Bug SSD -> CSD -> SSD -> Constrain Pointer -> CSD -> No Bug SSD -> CSD -> Constrain Pointer -> Bug SSD -> CSD -> SSD -> CSD -> Constrain Pointer -> No Bug SOFTWARE/OS VERSIONS Linux: ArchLinux 5.15.19-lts KDE Plasma Version: 5.23.5 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.2 Wayland-Protocols Version: 1.25 NVIDIA Driver Version: 510.47.03
Created attachment 146286 [details] A small C file that demonstrates the bug This is a small C file that demonstrates the bug. I have omitted error handling for brevity. I have not included xkbcommon to keep the code simpler, so you'll need to chose some appropriate scan-codes for controlling both ssd/csd and constraining. You can edit the KEY_ definitions at the top of the file. The current codes are 'u', 'l', 'c', 's', for US-ANSI keyboards.
Created attachment 146288 [details] CORRECTION: Small C program that demonstrates the bug. The previous attachment was archived incorrectly. See this for the correct file.
This bug was reported against an outdated version of KWin. We have made many changes since the. If the issue persists in newer versions can you reopen the bug report updating the version number.
(In reply to David Edmundson from comment #3) > This bug was reported against an outdated version of KWin. We have made many > changes since the. > If the issue persists in newer versions can you reopen the bug report > updating the version number. I've run some tests again on 5.27.7 and can confirm that the bug no longer appears. I'm not sure what the problem was but I think it was something to do with Kwin preserving the entire frame size when toggling between SSD and CSD. IIRC on 5.23 the window was maintaining the same client area size, and the client area wasn't moved or resized until another configure cycle, but the frame bounds were moved, meaning that the pointer was being confined to a region that didn't match where the client area was.