rust-windowing / rust-windowing/winit
`redraw_request` is ignored while the system popup menu is shown
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
Description
Repro
- Apply the following patch to repeat requesting redraw.
diff --git a/winit/examples/window.rs b/winit/examples/window.rs index f0a8ba9c..9f711890 100644 --- a/winit/examples/window.rs +++ b/winit/examples/window.rs @@ -66,7 +66,7 @@ impl ApplicationHandler for App { buffer.present().expect("Failed to present the softbuffer buffer"); // For contiguous redraw loop you can request a redraw from here. - // window.request_redraw(); + surface.window().request_redraw(); }, _ => (), } - Run
cargo run --example window. At this point,RedrawRequestedlog continues to repeat. - Click the small icon at the left top of the window.
- System popup menu is opened.
- Click the icon again to close the menu.
Expected behavior
The redraw_requested call is not ignored. The expectation is one of the followings:
- the
RedrawRequestedlog continues to repeat while the menu is shown - the
RedrawRequestedlog is pending while the menu is shown and is resumed after the menu is closed
Actual behavior
The RedrawRequested log stopped when the popup menu was opened and was never resumed after the menu was closed. The redraw request loop completely stopped.
The timing of RedrawRequested events is not guaranteed, but they must be eventually emitted because request_redraw queues the event. However in this case the redraw request was ignored and the event was dropped.
Windows version
Microsoft Windows [Version 10.0.26200.8655]
Winit version
HEAD 27e17e3f29439d0956e51f92f6e5d5470104e6b6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with cargo run --example window after applying the change in winit/examples/window.rs. Start by tracing how repeated RedrawRequested events from request_redraw are handled when the Windows system popup menu opens and closes. Done means redraw requests are not dropped and the loop continues or resumes after the menu closes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100