rust-windowing / rust-windowing/winit

`redraw_request` is ignored while the system popup menu is shown

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

Nobody has claimed this yet.

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

Description

Description
Repro
  1. 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();
                 },
                 _ => (),
             }
    
  2. Run cargo run --example window. At this point, RedrawRequested log continues to repeat.
  3. Click the small icon at the left top of the window.
  4. System popup menu is opened.
    Image
  5. 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 RedrawRequested log continues to repeat while the menu is shown
  • the RedrawRequested log 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.