Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

fix: workspace loses children on `move_workspace` command

Lars Berger061d150cad99
diff --git a/packages/wm/src/containers/commands/detach_container.rs b/packages/wm/src/containers/commands/detach_container.rs
index 05649667..4e924292 100644
--- a/packages/wm/src/containers/commands/detach_container.rs
+++ b/packages/wm/src/containers/commands/detach_container.rs
@@ -35,7 +35,6 @@ pub fn detach_container(child_to_remove: Container) -> anyhow::Result<()> {
.retain(|id| *id != child_to_remove.id());
*child_to_remove.borrow_parent_mut() = None;
- *child_to_remove.borrow_children_mut() = VecDeque::new();
// Resize the siblings if it is a tiling container.
if let Ok(child_to_remove) = child_to_remove.as_tiling_container() {
diff --git a/packages/wm/src/wm.rs b/packages/wm/src/wm.rs
index 76d99c40..030750d6 100644
--- a/packages/wm/src/wm.rs
+++ b/packages/wm/src/wm.rs
@@ -14,7 +14,7 @@ use crate::{
handle_window_moved_or_resized, handle_window_shown,
handle_window_title_changed,
},
- platform::{Platform, PlatformEvent},
+ platform::PlatformEvent,
},
containers::traits::CommonGetters,
user_config::UserConfig,
diff --git a/packages/wm/src/workspaces/commands/move_workspace_in_direction.rs b/packages/wm/src/workspaces/commands/move_workspace_in_direction.rs
index 4a384e89..b1ca5c36 100644
--- a/packages/wm/src/workspaces/commands/move_workspace_in_direction.rs
+++ b/packages/wm/src/workspaces/commands/move_workspace_in_direction.rs
@@ -50,6 +50,11 @@ pub fn move_workspace_in_direction(
}
}
+ state
+ .pending_sync
+ .containers_to_redraw
+ .push(workspace.clone().into());
+
// Prevent original monitor from having no workspaces.
if monitor.child_count() == 0 {
activate_workspace(None, &monitor, state, config)?;