Skip to content

[MacOS] Continuous events like MouseMotion and MouseWheel seem laggy in 0.20 #1418

@slmjkdbtl

Description

@slmjkdbtl

before 0.20 (pseudocode):

// smooth
loop {
    ev.poll_events(|e| {
        match e {
            DeviceEvent::MouseMotion => {
                // deal with mouse movement
            }
        }
    });
    update();
    render();
}

after 0.20:

// laggy
ev.run(move |e, flow| {
    match e {
        DeviceEvent::MouseMotion => {
            // deal with mouse movement
        },
        RedrawRequested => {
            update();
            render();
        }
        MainEventsCleared => {
            window.request_redraw();
        }
    }
})

Not sure if it's me not setting up correctly. It's pretty obvious in my 3d first person camera example, the example is running at >60fps, movement with keyboard is smooth, but the camera movement which responds to mousemove looks like 20 fps. I have 2 binaries for comparison between 2 versions (I'm using glutin not winit directly, so glutin 0.22 vs glutin 0.21): mousemove_lag_test.zip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedC - needs investigationIssue must be confirmed and researchedDS - appkitAffects the AppKit/macOS backendH - help wantedSomeone please save us

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions