Merge pull request #796 from hecrj/fix/redraw-empty-window

Skip redrawing if window has no surface
This commit is contained in:
Héctor Ramón 2021-03-26 15:16:28 +01:00 committed by GitHub
commit bbb4e4678f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -299,11 +299,16 @@ async fn run_instance<A, E, C>(
messages.push(message);
}
event::Event::RedrawRequested(_) => {
let physical_size = state.physical_size();
if physical_size.width == 0 || physical_size.height == 0 {
continue;
}
debug.render_started();
let current_viewport_version = state.viewport_version();
if viewport_version != current_viewport_version {
let physical_size = state.physical_size();
let logical_size = state.logical_size();
debug.layout_started();