fix(panes): no-op on unset fullscreen when no clients are connected (#3166)
* fix(panes): no-op on unset fullscreen when no clients are connected * style(fmt): rustfmt
This commit is contained in:
parent
7bd77ccc61
commit
de8ecafcd2
1 changed files with 30 additions and 27 deletions
|
|
@ -1571,9 +1571,11 @@ impl TiledPanes {
|
|||
if self.fullscreen_is_active {
|
||||
let first_client_id = {
|
||||
let connected_clients = self.connected_clients.borrow();
|
||||
*connected_clients.iter().next().unwrap()
|
||||
connected_clients.iter().next().copied()
|
||||
};
|
||||
let active_pane_id = self.get_active_pane_id(first_client_id).unwrap();
|
||||
if let Some(active_pane_id) =
|
||||
first_client_id.and_then(|first_client_id| self.get_active_pane_id(first_client_id))
|
||||
{
|
||||
let panes_to_hide: Vec<_> = self.panes_to_hide.iter().copied().collect();
|
||||
for pane_id in panes_to_hide {
|
||||
let pane = self.get_pane_mut(pane_id).unwrap();
|
||||
|
|
@ -1602,6 +1604,7 @@ impl TiledPanes {
|
|||
self.fullscreen_is_active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn toggle_active_pane_fullscreen(&mut self, client_id: ClientId) {
|
||||
if let Some(active_pane_id) = self.get_active_pane_id(client_id) {
|
||||
if self.fullscreen_is_active {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue