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,13 +729,17 @@ impl Workspaces {
let new_set = self.sets.get_mut(&new_output).unwrap();
let workspace_group = new_set.group;
for mut workspace in set.workspaces.into_iter() {
// update workspace protocol state
move_workspace_to_group(&mut workspace, &workspace_group, workspace_state);
if workspace.is_empty() {
workspace_state.remove_workspace(workspace.handle);
} else {
// update workspace protocol state
move_workspace_to_group(&mut workspace, &workspace_group, workspace_state);
// update mapping
workspace.set_output(&new_output);
workspace.refresh(xdg_activation_state);
new_set.workspaces.push(workspace);
// update mapping
workspace.set_output(&new_output);
workspace.refresh(xdg_activation_state);
new_set.workspaces.push(workspace);
}
}
for window in set.sticky_layer.mapped() {