mirror of
https://github.com/wez/wezterm.git
synced 2025-01-08 23:17:36 +03:00
use iter_panes_ignoring zoom in more places in the mux
`iter_panes` returns the renderable set of panes, but most functions in the mux want to operate on the full set of panes. Notably, when closing a tab, we were not killing panes other than the zoomed pane, which caused wezterm to linger in the background. refs: https://github.com/wez/wezterm/issues/2548
This commit is contained in:
parent
8e7a2cce79
commit
61752504dd
@ -61,6 +61,9 @@ As features stabilize some brief notes about them will accumulate here.
|
|||||||
active [#2529](https://github.com/wez/wezterm/issues/2529)
|
active [#2529](https://github.com/wez/wezterm/issues/2529)
|
||||||
* Overlays did not see config overrides set via `window:set_config_overrides`
|
* Overlays did not see config overrides set via `window:set_config_overrides`
|
||||||
[#2544](https://github.com/wez/wezterm/issues/2544)
|
[#2544](https://github.com/wez/wezterm/issues/2544)
|
||||||
|
* Closing a window while tab had a zoomed pane would leave the other panes
|
||||||
|
untouched and wezterm would linger in the background
|
||||||
|
[#2548](https://github.com/wez/wezterm/issues/2548)
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
* Removed Last Resort fallback font
|
* Removed Last Resort fallback font
|
||||||
|
@ -82,7 +82,7 @@ pub trait Domain: Downcast {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let pane_index = match tab
|
let pane_index = match tab
|
||||||
.iter_panes()
|
.iter_panes_ignoring_zoom()
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.pane.pane_id() == pane_id)
|
.find(|p| p.pane.pane_id() == pane_id)
|
||||||
{
|
{
|
||||||
|
@ -685,9 +685,10 @@ impl Mux {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut pane_ids = vec![];
|
let mut pane_ids = vec![];
|
||||||
for pos in tab.iter_panes() {
|
for pos in tab.iter_panes_ignoring_zoom() {
|
||||||
pane_ids.push(pos.pane.pane_id());
|
pane_ids.push(pos.pane.pane_id());
|
||||||
}
|
}
|
||||||
|
log::debug!("panes to remove: {pane_ids:?}");
|
||||||
for pane_id in pane_ids {
|
for pane_id in pane_ids {
|
||||||
self.remove_pane_internal(pane_id);
|
self.remove_pane_internal(pane_id);
|
||||||
}
|
}
|
||||||
@ -893,7 +894,7 @@ impl Mux {
|
|||||||
pub fn resolve_pane_id(&self, pane_id: PaneId) -> Option<(DomainId, WindowId, TabId)> {
|
pub fn resolve_pane_id(&self, pane_id: PaneId) -> Option<(DomainId, WindowId, TabId)> {
|
||||||
let mut ids = None;
|
let mut ids = None;
|
||||||
for tab in self.tabs.borrow().values() {
|
for tab in self.tabs.borrow().values() {
|
||||||
for p in tab.iter_panes() {
|
for p in tab.iter_panes_ignoring_zoom() {
|
||||||
if p.pane.pane_id() == pane_id {
|
if p.pane.pane_id() == pane_id {
|
||||||
ids = Some((tab.tab_id(), p.pane.domain_id()));
|
ids = Some((tab.tab_id(), p.pane.domain_id()));
|
||||||
break;
|
break;
|
||||||
|
@ -1484,7 +1484,7 @@ impl Tab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn can_close_without_prompting(&self, reason: CloseReason) -> bool {
|
pub fn can_close_without_prompting(&self, reason: CloseReason) -> bool {
|
||||||
let panes = self.iter_panes();
|
let panes = self.iter_panes_ignoring_zoom();
|
||||||
for pos in &panes {
|
for pos in &panes {
|
||||||
if !pos.pane.can_close_without_prompting(reason) {
|
if !pos.pane.can_close_without_prompting(reason) {
|
||||||
return false;
|
return false;
|
||||||
@ -1511,7 +1511,7 @@ impl Tab {
|
|||||||
return Some(Rc::clone(zoomed));
|
return Some(Rc::clone(zoomed));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.iter_panes()
|
self.iter_panes_ignoring_zoom()
|
||||||
.iter()
|
.iter()
|
||||||
.nth(*self.active.borrow())
|
.nth(*self.active.borrow())
|
||||||
.map(|p| Rc::clone(&p.pane))
|
.map(|p| Rc::clone(&p.pane))
|
||||||
@ -1524,7 +1524,7 @@ impl Tab {
|
|||||||
|
|
||||||
pub fn set_active_pane(&self, pane: &Rc<dyn Pane>) {
|
pub fn set_active_pane(&self, pane: &Rc<dyn Pane>) {
|
||||||
if let Some(item) = self
|
if let Some(item) = self
|
||||||
.iter_panes()
|
.iter_panes_ignoring_zoom()
|
||||||
.iter()
|
.iter()
|
||||||
.find(|p| p.pane.pane_id() == pane.pane_id())
|
.find(|p| p.pane.pane_id() == pane.pane_id())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user