1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 02:25:28 +03:00

overlays: handle resize better

We need to actually tell them that the pane has been resized
so now we do.
This commit is contained in:
Wez Furlong 2022-07-15 16:32:26 -07:00
parent 3d616ffb3d
commit e277183cb9
3 changed files with 31 additions and 0 deletions

View File

@ -49,6 +49,7 @@ As features stabilize some brief notes about them will accumulate here.
* Unix: Clicking a URL when no browser is open could cause wezterm to hang until the newly opened browser is closed. [#2245](https://github.com/wez/wezterm/issues/2245)
* Quickselect: now selects the bottom-most match rather than the top-most match. [#2250](https://github.com/wez/wezterm/issues/2250)
* Mux: `wezterm.mux.set_active_workspace` didn't update the current window to match the newly activated workspace. [#2248](https://github.com/wez/wezterm/issues/2248)
* Overlays such as debug and launcher menu now handle resize better
#### Updated
* Bundled harfbuzz to 4.4.1

View File

@ -2672,6 +2672,35 @@ impl TermWindow {
})
}
/// Resize overlays to match their corresponding tab/pane dimensions
pub fn resize_overlays(&self) {
let mux = Mux::get().unwrap();
for (_, state) in self.tab_state.borrow().iter() {
if let Some(overlay) = state.overlay.as_ref().map(|o| &o.pane) {
overlay.resize(self.terminal_size).ok();
}
}
for (pane_id, state) in self.pane_state.borrow().iter() {
if let Some(overlay) = state.overlay.as_ref().map(|o| &o.pane) {
if let Some(pane) = mux.get_pane(*pane_id) {
let dims = pane.get_dimensions();
overlay
.resize(TerminalSize {
cols: dims.cols,
rows: dims.viewport_rows,
dpi: self.terminal_size.dpi,
pixel_height: (self.terminal_size.pixel_height
/ self.terminal_size.rows)
* dims.viewport_rows,
pixel_width: (self.terminal_size.pixel_width / self.terminal_size.cols)
* dims.cols,
})
.ok();
}
}
}
}
pub fn get_viewport(&self, pane_id: PaneId) -> Option<StableRowIndex> {
self.pane_state(pane_id).viewport
}

View File

@ -260,6 +260,7 @@ impl super::TermWindow {
tab.resize(size);
}
};
self.resize_overlays();
self.invalidate_fancy_tab_bar();
self.update_title();