-
Notifications
You must be signed in to change notification settings - Fork 947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sequence of mouse movements seems out of order when using trackpad on macOS #3516
Comments
Huh, in general, I find it odd the amount of places we're calling Will need to do some digging in the project history to see why it is like it is. |
This was added in #1490, but I can't seem to reproduce the original issue, it's possible that issue has been fixed in macOS itself in the meantime, and the workaround is unnecessary in newer versions? |
I tried debug-logging the data in the event sent to Can you provide a minimal example where you can reproduce the jittery behaviour? Maybe by trying one of the examples in this repo (likely |
I had a hard time identifying the jitter via the Here is an example: ![]() I just updated to macOS 14.4 and the issue still happens. Maybe it is specific to the macbook M1 pro because of the 120hz refresh rate or something like that? |
In particular, we don't want to emit those events inside of `pressureChangeWithEvent:`, since the mouse motion value is sometimes outdated. Fixes #3516
In particular, we don't want to emit those events inside of `pressureChangeWithEvent:`, since the mouse motion value is sometimes outdated. Fixes #3516
In particular, we don't want to emit those events inside of `pressureChangeWithEvent:`, since the mouse motion value is sometimes outdated. Additionally, we want to ensure the events have been emitted during other gestures. Fixes #3516
Thanks for the example, I could reproduce the problem (even with a refresh rate of 60Hz, so I don't think that's it). I've opened #3601 to fix this in the manner you suggested to begin with. |
In particular, we don't want to emit those events inside of `pressureChangeWithEvent:`, since the mouse motion value is sometimes outdated. Additionally, we want to ensure the events have been emitted during other gestures. Fixes #3516
In particular, we don't want to emit those events inside of `pressureChangeWithEvent:`, since the mouse motion value is sometimes outdated. Additionally, we want to ensure the events have been emitted during other gestures. Fixes #3516
I'm developing a drawing application and I noticed a weird artifact with mouse positions when drawing with a trackpad on macOS (I'm using a macbook M1 pro on macOS 14.3.1, and using winit 0.29.10).
What I do is each frame I collect all of the incoming positions
CursorMoved
window event and store them in a vec. Then when it comes to draw the frame I connect these points with lines.When using a mouse everything works fine, but when using a trackpad I noticed that I got a lot of weird loops and spikes coming out of the drawn lines. For instance:
In the image above different colors refer to different frames. Notice that the blue line does a sort of 'V' shape, so it appears the mouse locations are coming in out of order.
By commenting out this line,
winit/src/platform_impl/macos/view.rs
Line 738 in a127bd6
which then blocks the
pressureChange
event from emittingCursorMoved
events, this artifacts go away and everything works correctly.It seems like the position from
pressureChange
is not equivalent from regular mouse positions, or maybe macOS does not process them in the same order, causing these loops to appear.The text was updated successfully, but these errors were encountered: