1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00

window: fix synthesized configure event for Wayland DPI scale (fixes #1111)

This commit is contained in:
Greg V 2021-09-07 02:17:54 +03:00 committed by Wez Furlong
parent 86f0bae1db
commit 5b85e80b75

View File

@ -537,13 +537,15 @@ impl WaylandWindowInner {
self.window_state = window_state;
}
if pending.configure.is_none() && pending.dpi.is_some() {
// Synthesize a pending configure event for the dpi change
pending.configure.replace((
self.pixels_to_surface(self.dimensions.pixel_width as i32) as u32,
self.pixels_to_surface(self.dimensions.pixel_height as i32) as u32,
));
log::debug!("synthesize configure with {:?}", pending.configure);
if pending.configure.is_none() {
if let Some(scale) = pending.dpi {
// Synthesize a pending configure event for the dpi change
pending.configure.replace((
self.pixels_to_surface(self.dimensions.pixel_width as i32 * scale) as u32,
self.pixels_to_surface(self.dimensions.pixel_height as i32 * scale) as u32,
));
log::debug!("synthesize configure with {:?}", pending.configure);
}
}
if let Some((w, h)) = pending.configure.take() {