1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00

gui: fix wonky logic for simple_dpi_change

The condition should be: dpi-changed && (close-enough-stuff)
but was (dpi-changed && (some-close-enough-stuff)) ||
(other-close-enough-stuff).

The net result was toggling non-native full screen on macos could
falsely try to do scale change handling even though the dpi was
unchanged, because the window resized by only a couple of pixels.
This commit is contained in:
Wez Furlong 2022-03-27 16:28:07 -07:00
parent b9c194c0d3
commit 53fc926b1c

View File

@ -306,20 +306,19 @@ impl super::TermWindow {
// where the window manager also decides to tile/resize the window.
// In the latter case, we don't want to preserve the terminal rows/cols.
let simple_dpi_change = dimensions.dpi != self.dimensions.dpi
&& (close_enough(
&& ((close_enough(
dpi_adjusted(dimensions.pixel_height, dimensions.dpi),
dpi_adjusted(self.dimensions.pixel_height, self.dimensions.dpi),
) && close_enough(
dpi_adjusted(dimensions.pixel_width, dimensions.dpi),
dpi_adjusted(self.dimensions.pixel_width, self.dimensions.dpi),
))
|| (close_enough(
)) || (close_enough(
dimensions.pixel_width as f32,
self.dimensions.pixel_width as f32,
) && close_enough(
dimensions.pixel_height as f32,
self.dimensions.pixel_height as f32,
));
)));
let dpi_changed = dimensions.dpi != self.dimensions.dpi;
let font_scale_changed = font_scale != self.fonts.get_font_scale();