rust-windowing / rust-windowing/winit

Changing cursor properties while window is being resized crashes in browser

Open
#4,110 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug DS - web
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the web event-loop implementation at winit-0.30.8/src/platform_impl/web/event_loop/runner.rs:599 and reproduce the panic using the linked curs-reprod project while resizing the browser window. Trace the cursor-related calls and the existing ExternalError behavior. Done means repeated cursor changes during resizing no longer panic, with failure reported through the existing API where applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
desktop, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.