Bug 478462

Summary: webkit Element.requestPointerLock() lets pointer move
Product: [Plasma] kwin Reporter: steve <ostylehouse>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: kde
Priority: NOR    
Version: 5.27.5   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description steve 2023-12-13 01:27:36 UTC
SUMMARY
During Element.requestPointerLock() the pointer is hidden but on release it reappears away from where it began.
Also it can hit the edge of your (desktop?) screen.

STEPS TO REPRODUCE
1. in chrome or brave but not firefox, go to https://svelte-dj-knob.netlify.app/
2. click+drag up

OBSERVED RESULT
pointer reappears above the knob.

EXPECTED RESULT
pointer reappears where it began the lock.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 12
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.0-13-amd64 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
It works fine on firefox, X11, or if your pointerdown event is within about 20px of the edge of the page.
Blaming kwin is based on not reproducing on two people's other compositors via oftc #wayland.
Perhaps someone can try it! Cheers.
Comment 1 steve 2023-12-13 04:31:34 UTC
It affects chromium 119 and 120.0.6099.71,
In 120 it works if your pointerdown event is within about 100px of the edge of the page (up from 20px)
to try that,
  resize that page so the space above the ring is the same as the thickness of the ring,
  drags from the top of the ring will work, but not the bottom.
Comment 2 steve 2023-12-13 06:56:36 UTC
it is for all pointerlock demos I can find or build, like this one:
https://www.smartjava.org/examples/pointerlock/
here's a video:
https://youtu.be/iK4VljDoVfg
the first drag locked, the second doesn't.
Comment 3 David Edmundson 2023-12-23 22:24:32 UTC
Works here in Plasma 6. If you can test that when 6 is out that would be great