From 634eb20a1fafb748cb253777c3747439cce52608 Mon Sep 17 00:00:00 2001 From: Lars Berger Date: Mon, 16 Sep 2024 23:34:40 +0800 Subject: [PATCH] fix: ensure windows aren't unmanaged when moved to workspace --- packages/wm/src/common/events/handle_window_shown.rs | 4 +++- packages/wm/src/windows/commands/move_window_to_workspace.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/wm/src/common/events/handle_window_shown.rs b/packages/wm/src/common/events/handle_window_shown.rs index 84adff24..a9b795e7 100644 --- a/packages/wm/src/common/events/handle_window_shown.rs +++ b/packages/wm/src/common/events/handle_window_shown.rs @@ -17,11 +17,13 @@ pub fn handle_window_shown( match found_window { Some(window) => { // TODO: Log window details. - info!("Showing window"); + info!("Window shown"); // Update display state if window is already managed. if window.display_state() == DisplayState::Showing { window.set_display_state(DisplayState::Shown); + } else { + state.pending_sync.containers_to_redraw.push(window.into()); } } None => { diff --git a/packages/wm/src/windows/commands/move_window_to_workspace.rs b/packages/wm/src/windows/commands/move_window_to_workspace.rs index cba1c139..ae9788dc 100644 --- a/packages/wm/src/windows/commands/move_window_to_workspace.rs +++ b/packages/wm/src/windows/commands/move_window_to_workspace.rs @@ -128,6 +128,7 @@ pub fn move_window_to_workspace( WindowContainer::NonTilingWindow(_) => vec![window.into()], WindowContainer::TilingWindow(_) => current_workspace .tiling_children() + .chain(target_workspace.tiling_children()) .map(Into::into) .collect(), };