fix(floating-panes): reset swap floating layouts when closing last floating pane (#4012)

This commit is contained in:
Aram Drevekenin 2025-02-21 12:16:47 +01:00 committed by GitHub
parent 2c8ef3b5b8
commit f16804b8c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -2786,6 +2786,7 @@ impl Tab {
let _closed_pane = self.floating_panes.remove_pane(id); let _closed_pane = self.floating_panes.remove_pane(id);
self.floating_panes.move_clients_out_of_pane(id); self.floating_panes.move_clients_out_of_pane(id);
if !self.floating_panes.has_panes() { if !self.floating_panes.has_panes() {
self.swap_layouts.reset_floating_damage();
self.hide_floating_panes(); self.hide_floating_panes();
} }
self.set_force_render(); self.set_force_render();
@ -2846,6 +2847,7 @@ impl Tab {
let mut closed_pane = self.floating_panes.remove_pane(id); let mut closed_pane = self.floating_panes.remove_pane(id);
self.floating_panes.move_clients_out_of_pane(id); self.floating_panes.move_clients_out_of_pane(id);
if !self.floating_panes.has_panes() { if !self.floating_panes.has_panes() {
self.swap_layouts.reset_floating_damage();
self.hide_floating_panes(); self.hide_floating_panes();
} }
self.set_force_render(); self.set_force_render();

View file

@ -61,6 +61,12 @@ impl SwapLayouts {
pub fn set_is_tiled_damaged(&mut self) { pub fn set_is_tiled_damaged(&mut self) {
self.is_tiled_damaged = true; self.is_tiled_damaged = true;
} }
pub fn reset_floating_damage(&mut self) {
self.is_floating_damaged = false;
}
pub fn reset_tiled_damage(&mut self) {
self.is_tiled_damaged = false;
}
pub fn is_floating_damaged(&self) -> bool { pub fn is_floating_damaged(&self) -> bool {
self.is_floating_damaged self.is_floating_damaged
} }