Skip to content

Changing cursor properties while window is being resized crashes in browser #4110

@benjamin-sieffert

Description

@benjamin-sieffert

Description

Reproducer: https://github.com/benjamin-sieffert/curs-reprod

Calling cursor-related functions, e.g. set_cursor_visible while the browser window containing winit+wgpu application is being resized, leads to a panic. This happens even when the state of the cursor would not even change (e.g. always calling set_cursor_visible(true)).

The error is:
winit-0.30.8/src/platform_impl/web/event_loop/runner.rs:599:30 (already borrowed: BorrowMutError)

I understand that due to rendering and event delivery interfering with each other, it may not be possible to make this "work."
It would be nice if it did not panic. Some cursor functions also return ExternalError already, this could be used to signal failure instead of a panic.

Cheers

Tested browsers

Chrome, Firefox

Tested devices

Linux PC
Windows PC

Winit version

winit: 0.30.8
wgpu: 24.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - webAffects the Web backend (WebAssembly/WASM)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions