Skip to content

redraw_request is ignored while the system popup menu is shown #4608

Description

@rhysd

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 27e17e3

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - win32Affects the Win32/Windows backend

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions