On Wayland, fix Window::request_inner_size during resize

The user may change the size during the on-going resize, meaning that
the size will desync with winit's internal loop which breaks viewporter
setup with fractional scaling.

Links: https://github.com/alacritty/alacritty/issues/7474
This commit is contained in:
Kirill Chibisov 2023-12-29 21:28:06 +04:00 committed by GitHub
parent ad1843aea6
commit 8f6de4ef4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 50 additions and 59 deletions

View file

@ -287,7 +287,7 @@ impl Window {
pub fn inner_size(&self) -> PhysicalSize<u32> {
let window_state = self.window_state.lock().unwrap();
let scale_factor = window_state.scale_factor();
window_state.inner_size().to_physical(scale_factor)
super::logical_to_physical_rounded(window_state.inner_size(), scale_factor)
}
#[inline]
@ -315,7 +315,7 @@ impl Window {
pub fn outer_size(&self) -> PhysicalSize<u32> {
let window_state = self.window_state.lock().unwrap();
let scale_factor = window_state.scale_factor();
window_state.outer_size().to_physical(scale_factor)
super::logical_to_physical_rounded(window_state.outer_size(), scale_factor)
}
#[inline]