Fix issues with redraw_requested when called during EventsCleared (#994)

* Fix issues with redraw_requested when called during EventsCleared

* Format

* Fix event dispatch after RedrawRequested but before EventsCleared

This could happen if the event queue was cleared, we processed WM_PAINT,
but the event queue got re-filled before we checked to see it was empty.

* Fix paint ordering issues when resizing window

* Format
This commit is contained in:
Osspial 2019-07-04 16:14:15 -04:00 committed by GitHub
parent 9393b14b01
commit 74a7cf55ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 23 deletions

View file

@ -30,6 +30,9 @@ pub struct WindowState {
pub dpi_factor: f64,
pub fullscreen: Option<MonitorHandle>,
/// Used to supress duplicate redraw attempts when calling `request_redraw` multiple
/// times in `EventsCleared`.
pub queued_out_of_band_redraw: bool,
window_flags: WindowFlags,
}
@ -110,6 +113,7 @@ impl WindowState {
dpi_factor,
fullscreen: None,
queued_out_of_band_redraw: false,
window_flags: WindowFlags::empty(),
}
}