winit: Don't resize in resize handler

The resize handler with a window resize request causes oscillations between two window sizes (presumably the inner and the outer). While it's not clear what part of the stack causes it, checking `window.get_inner_size()` already presents the correct size.

Either way, changing the same property in its change handler is a recipe for feedback loops as this one and should be avoided whenever possible, and then carefully fortified too.
This commit is contained in:
Dorota Czaplejewicz 2020-04-05 18:41:40 +00:00 committed by Victor Berger
parent 1b5537d537
commit 178a447394
1 changed files with 0 additions and 1 deletions

View File

@ -701,7 +701,6 @@ impl InputBackend for WinitInputBackend {
match (event, handler.as_mut(), events_handler.as_mut()) { match (event, handler.as_mut(), events_handler.as_mut()) {
(WindowEvent::Resized(size), _, events_handler) => { (WindowEvent::Resized(size), _, events_handler) => {
trace!(logger, "Resizing window to {:?}", size); trace!(logger, "Resizing window to {:?}", size);
window.window().set_inner_size(size);
let mut wsize = window_size.borrow_mut(); let mut wsize = window_size.borrow_mut();
wsize.logical_size = size; wsize.logical_size = size;
let physical_size = size.to_physical(wsize.dpi_factor); let physical_size = size.to_physical(wsize.dpi_factor);