1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 13:52:55 +03:00

gui: pass window to set_inner_size()

This fixes a regression from a0974a25 where TermWindow::set_inner_size()
can be called before the TermWindow's window has been set.
This commit is contained in:
Jeffrey Knockel 2024-02-18 00:26:20 -05:00 committed by Wez Furlong
parent 22f9f8d288
commit cd5d1f5ea1
2 changed files with 5 additions and 7 deletions

View File

@ -1301,18 +1301,16 @@ impl TermWindow {
window.invalidate();
}
TermWindowNotif::SetInnerSize { width, height } => {
self.set_inner_size(width, height);
self.set_inner_size(window, width, height);
}
}
Ok(())
}
fn set_inner_size(&mut self, width: usize, height: usize) {
if let Some(window) = &self.window {
self.resizes_pending += 1;
window.set_inner_size(width, height);
}
fn set_inner_size(&mut self, window: &Window, width: usize, height: usize) {
self.resizes_pending += 1;
window.set_inner_size(width, height);
}
/// Take care to remove our panes from the mux, otherwise

View File

@ -337,7 +337,7 @@ impl super::TermWindow {
// pixel geometry which is considered to be a user-driven resize.
// Stashing the dimensions here avoids that misconception.
self.dimensions = dims;
self.set_inner_size(dims.pixel_width, dims.pixel_height);
self.set_inner_size(window, dims.pixel_width, dims.pixel_height);
}
}
}