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

defer loading background until after rescaling in config reload

render metrics might be adjusted by the scaling logic, so we
should load the background after resizing.
This commit is contained in:
Wez Furlong 2023-02-07 07:40:20 -07:00
parent f6d8b309c0
commit d2905d53b1
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -1553,13 +1553,6 @@ impl TermWindow {
self.config = config.clone();
self.palette.take();
self.window_background = reload_background_image(
&config,
&self.window_background,
&self.dimensions,
&self.render_metrics,
);
let mux = Mux::get();
let window = match mux.get_window(self.mux_window_id) {
Some(window) => window,
@ -1644,6 +1637,15 @@ impl TermWindow {
window.invalidate();
}
// Do this after we've potentially adjusted scaling based on config/padding
// and window size
self.window_background = reload_background_image(
&config,
&self.window_background,
&self.dimensions,
&self.render_metrics,
);
self.invalidate_modal();
self.emit_window_event("window-config-reloaded", None);
}