From bf34be3ab845d6fc3e1a45dca0fcd3331cac88e9 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 11 Dec 2021 09:43:32 -0700 Subject: [PATCH] gui: ResetFontAndWindowSize should use known dpi This code was partially replicating the initial window setup where we didn't necessarily know the dpi, but in the context where this is run, we do know the dpi for the window, so let's consistently use that number throughout. refs: #1039 --- wezterm-gui/src/termwindow/resize.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wezterm-gui/src/termwindow/resize.rs b/wezterm-gui/src/termwindow/resize.rs index 87b0b405b..c5cbf685d 100644 --- a/wezterm-gui/src/termwindow/resize.rs +++ b/wezterm-gui/src/termwindow/resize.rs @@ -327,7 +327,7 @@ impl super::TermWindow { let size = config.initial_size(); let fontconfig = Rc::new(FontConfiguration::new( Some(config.clone()), - config.dpi.unwrap_or_else(|| ::window::default_dpi()) as usize, + self.dimensions.dpi, )?); let render_metrics = RenderMetrics::new(&fontconfig)?; @@ -367,7 +367,7 @@ impl super::TermWindow { + padding_top + padding_bottom) as usize + tab_bar_height, - dpi: config.dpi.unwrap_or_else(|| ::window::default_dpi()) as usize, + dpi: self.dimensions.dpi, }; self.apply_scale_change(&dimensions, 1.0, window);