mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 06:12:16 +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:
parent
b9c194c0d3
commit
53fc926b1c
@ -306,20 +306,19 @@ impl super::TermWindow {
|
|||||||
// where the window manager also decides to tile/resize the window.
|
// 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.
|
// In the latter case, we don't want to preserve the terminal rows/cols.
|
||||||
let simple_dpi_change = dimensions.dpi != self.dimensions.dpi
|
let simple_dpi_change = dimensions.dpi != self.dimensions.dpi
|
||||||
&& (close_enough(
|
&& ((close_enough(
|
||||||
dpi_adjusted(dimensions.pixel_height, dimensions.dpi),
|
dpi_adjusted(dimensions.pixel_height, dimensions.dpi),
|
||||||
dpi_adjusted(self.dimensions.pixel_height, self.dimensions.dpi),
|
dpi_adjusted(self.dimensions.pixel_height, self.dimensions.dpi),
|
||||||
) && close_enough(
|
) && close_enough(
|
||||||
dpi_adjusted(dimensions.pixel_width, dimensions.dpi),
|
dpi_adjusted(dimensions.pixel_width, dimensions.dpi),
|
||||||
dpi_adjusted(self.dimensions.pixel_width, self.dimensions.dpi),
|
dpi_adjusted(self.dimensions.pixel_width, self.dimensions.dpi),
|
||||||
))
|
)) || (close_enough(
|
||||||
|| (close_enough(
|
|
||||||
dimensions.pixel_width as f32,
|
dimensions.pixel_width as f32,
|
||||||
self.dimensions.pixel_width as f32,
|
self.dimensions.pixel_width as f32,
|
||||||
) && close_enough(
|
) && close_enough(
|
||||||
dimensions.pixel_height as f32,
|
dimensions.pixel_height as f32,
|
||||||
self.dimensions.pixel_height as f32,
|
self.dimensions.pixel_height as f32,
|
||||||
));
|
)));
|
||||||
|
|
||||||
let dpi_changed = dimensions.dpi != self.dimensions.dpi;
|
let dpi_changed = dimensions.dpi != self.dimensions.dpi;
|
||||||
let font_scale_changed = font_scale != self.fonts.get_font_scale();
|
let font_scale_changed = font_scale != self.fonts.get_font_scale();
|
||||||
|
Loading…
Reference in New Issue
Block a user