Mouse cursor can break outside the window bounds while pointer is locked with Pointer Lock API
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: humph, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Comment 1•12 years ago
|
||
Comment 2•10 years ago
|
||
Updated•9 years ago
|
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
| Assignee | ||
Updated•6 years ago
|
Comment 8•5 years ago
|
||
(In reply to Alexandru Simonca [:asimonca], Release Desktop QA from comment #5)
I've been testing Pointer Lock API and saw this issue and investigated it a
little. This reproduces only on Mac and Ubuntu for me (not in Windows 10
x64)
I could also reproduce this on Window if the browser window is small enough.
Comment 9•5 years ago
•
|
||
I guess the issue is because the mouse moves too fast and makes it to be outside the browser before the content process tries to reset its position. After bug 1662587, now the content process will send an IPC to the parent to request a pointer lock, and maybe we could set pinter capture in the parent process while it knows which remote target requests a pointer lock?
Comment 10•5 years ago
•
|
||
Hmm, I could even reproduce this in non-e10s mode, so even in non-e10s, we don't set the captured content correctly.
(Correct: We do set the captured content correctly in non-e10s mode.)
Comment 11•5 years ago
|
||
My original thought was the issue is caused by the delay of IPC, but it seems not the real root cause given that this could also be reproduced even in non-e10s.
Comment 12•5 years ago
|
||
I am thinking maybe we could also handle eMouseExitFromWidget to reset the mouse position, I could try to this approach.
There is another potential issue on e10s: we don't set the captured content in parent process, so if the mouse is out the XULFrame but inside the browser window, for example, on URL bar or menu bar, we are unable to handle that case.
Comment 13•5 years ago
•
|
||
The issue here is that we are just repeatedly trying to move the pointer back to the center of the window, but we never really restrict the pointer within the window area.
IIRC all desktop platforms provide some kind of mouse movement restriction API, for example on macOS we may use CGAssociateMouseAndMouseCursorPosition to forbid the mouse cursor from being moved at all.
We would probably need to hook those APIs in order to fix this issue.
Comment 14•5 years ago
|
||
(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #13)
IIRC all desktop platforms provide some kind of mouse movement restriction API, for example on macOS we may use
CGAssociateMouseAndMouseCursorPositionto forbid the mouse cursor from being moved at all.We would probably need to hook those APIs in order to fix this issue.
Thanks for the comment! I will try this in bug 1255338 which is filed to change the way we implement pointer lock.
Updated•3 years ago
|
Description
•