mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
On Windows, fix RedrawRequested delivery
When calling `Window::request_redraw` from the `RedrawRequested` handler the `RedrawWindow` won't result in `WM_PAINT` being delivered due since user callback is run before `DefWindowProcW` is called. Track whether the user called `Window::request_redraw` and ask for `RedrawWindow` after running the said function during `WM_PAINT` handling. Fixes #3150.
This commit is contained in:
@@ -52,6 +52,9 @@ pub(crate) struct WindowState {
|
||||
pub is_active: bool,
|
||||
pub is_focused: bool,
|
||||
|
||||
// Flag whether redraw was requested.
|
||||
pub redraw_requested: bool,
|
||||
|
||||
pub dragging: bool,
|
||||
|
||||
pub skip_taskbar: bool,
|
||||
@@ -166,6 +169,7 @@ impl WindowState {
|
||||
|
||||
is_active: false,
|
||||
is_focused: false,
|
||||
redraw_requested: false,
|
||||
|
||||
dragging: false,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user