-
Notifications
You must be signed in to change notification settings - Fork 941
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
macOS mouse events are laggy #2240
Comments
Tried the tutorial you mentioned, using macOS 10.14.6 Mojave. I don't think I can reproduce what you're seeing with scrolling, that part seems just as smooth to me. I think I see what you mean with the mouse movement (specifically Internally we're using I don't really think there's a way to solve this? Apart from not using |
That's odd that you can't reproduce the issue. The latency of 2-3 pixels before the display updating isn't what I mean (although accumulating frame lag may be a different issue...). I did some more digging and found a better way to check whether the lagging event issue is occurring. The following diff against the linked repo illustrates the issue. I've also been able to reproduce it on another machine, this time running Monterey - a 2016 13" MacBook Pro. So it's not just a Big Sur bug, and it's not specific to my machine. diff --git a/code/intermediate/tutorial12-camera/src/lib.rs b/code/intermediate/tutorial12-camera/src/lib.rs
index 16d972b4..ef2f6bb4 100644
--- a/code/intermediate/tutorial12-camera/src/lib.rs
+++ b/code/intermediate/tutorial12-camera/src/lib.rs
@@ -546,6 +546,7 @@ impl State {
..
} => self.camera_controller.process_keyboard(*key, *state),
WindowEvent::MouseWheel { delta, .. } => {
+ println!("MouseWheel");
self.camera_controller.process_scroll(delta);
true
}
@@ -724,6 +725,7 @@ pub async fn run() {
}
// UPDATED!
Event::RedrawRequested(window_id) if window_id == window.id() => {
+ println!("RedrawRequested");
let now = instant::Instant::now();
let dt = now - last_render_time;
last_render_time = now; Running the example (
Adding a
This explains why mouse events feel so choppy. Any ideas? |
This is potentially a duplicate of #1418 |
0.26.1
Scroll and mouse move events on macOS feel like they run at a substantially lower frame rate than the window. This is exhibited in this wgpu tutorial. Near the bottom of the page, there is a "Try Tutorial12_camera" button, which opens up the demo. Scrolling on the demo in-browser is smooth, but when compiling and running it as a native application on macOS, scrolling (and dragging) is laggy.
I'm running into this issue in a different project (also using
wgpu
), so it's not specific to that particular demo. Using keyboard keys in both the web and native versions results in smooth frame rates, so it's not the demo itself that is running slower.The text was updated successfully, but these errors were encountered: