Prune unused empty workspaces while preserving visible outputs
This commit is contained in:
1 parent
0295b5be3e
commit
f87039562b
5 files changed
+148
-2
No files matched your search
@@ -507,7 +507,11 @@ impl Ferese {
|
||||
.map(|workspace| workspace.id)
|
||||
{
|
||||
self.activate_managed_workspace(workspace);
|
||||
} else if next {
|
||||
} else if next
|
||||
&& self.workspaces.workspace(current).is_some_and(|workspace| {
|
||||
workspace.layout.window_ids().next().is_some() || !workspace.floating.is_empty()
|
||||
})
|
||||
{
|
||||
let next_number = self
|
||||
.workspaces
|
||||
.iter()
|
||||
|
||||
@@ -1263,6 +1263,15 @@ impl Ferese {
|
||||
}
|
||||
|
||||
pub fn relayout(&mut self) {
|
||||
let protected = self
|
||||
.output_workspaces
|
||||
.connected_outputs()
|
||||
.filter_map(|output| self.output_workspaces.active_workspace(output))
|
||||
.collect::<HashSet<_>>();
|
||||
for workspace in self.workspaces.prune_empty(&protected) {
|
||||
self.output_workspaces.forget_workspace(workspace);
|
||||
self.viewport_animations.remove(&workspace);
|
||||
}
|
||||
if self.session_lock.active {
|
||||
self.configure_lock_surfaces();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user