When moving workspaces on output remove, don't movve empty workspace

This resulted in a somewhat weird effect, where the empty workspace at
the end on the monitor has an `output_stack` with the other output, so
a window created there is moved back to to second output when it is
re-connected. This seems unexpected.
This commit is contained in:
Ian Douglas Scott 2024-10-11 12:33:09 -07:00 committed by Victoria Brekenfeld
parent 6fc36cb00e
commit 400a7752fd

View file

@ -729,6 +729,9 @@ impl Workspaces {
let new_set = self.sets.get_mut(&new_output).unwrap(); let new_set = self.sets.get_mut(&new_output).unwrap();
let workspace_group = new_set.group; let workspace_group = new_set.group;
for mut workspace in set.workspaces.into_iter() { for mut workspace in set.workspaces.into_iter() {
if workspace.is_empty() {
workspace_state.remove_workspace(workspace.handle);
} else {
// update workspace protocol state // update workspace protocol state
move_workspace_to_group(&mut workspace, &workspace_group, workspace_state); move_workspace_to_group(&mut workspace, &workspace_group, workspace_state);
@ -737,6 +740,7 @@ impl Workspaces {
workspace.refresh(xdg_activation_state); workspace.refresh(xdg_activation_state);
new_set.workspaces.push(workspace); new_set.workspaces.push(workspace);
} }
}
for window in set.sticky_layer.mapped() { for window in set.sticky_layer.mapped() {
for (surface, _) in window.windows() { for (surface, _) in window.windows() {