You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
https://discord.com/channels/955905230107738152/1337534586707644416
There are other bugs I see on Windows on my machine -
`requestPointerLock` seems too buggy.
1. In my case, wrap-around is not working.
2. Fast clicks and movements can cause `pointerup` to not be intercepted
(because of the fix above).
Here’s how I see the issue:
- `requestPointerLock` is asynchronous.
- During `requestPointerLock`, we might get a `lostpointercapture`
event.
- This has a very low probability of happening on Mac.
- On Windows, the probability is very high _(it can be caused by calling
`requestPointerLock` itself, depending on the machine)_.
- On Mac, if this happens, the `pointerup` event will most likely be
lost.
- On Windows, the `pointerup` event is usually preserved but can be lost
as well.
Currently, on Windows, instead of cleanup, we assume everything will be
fine.
On Mac, we perform cleanup on the `lostpointercapture` event.
Windows' behavior is buggy, but I haven’t found a proper way to fix it.
There's no way to detect `event.buttons` on move, and this happens
independently of the `pointerleave` event.
Using body as lock target etc doesn't work too.
My suggestion - if this causes new bugs - is to remove
`requestPointerLock` entirely on Windows.
## Steps for reproduction
1. click button
3. expect xyz
## Code Review
- [ ] hi @kof, I need you to do
- conceptual review (architecture, feature-correctness)
- detailed review (read every line)
- test it on preview
## Before requesting a review
- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")
## Before merging
- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
0 commit comments