diff --git a/komorebi/src/container.rs b/komorebi/src/container.rs index f73f53a5..20283a25 100644 --- a/komorebi/src/container.rs +++ b/komorebi/src/container.rs @@ -116,6 +116,13 @@ impl Container { pub fn add_window(&mut self, window: Window) { self.windows_mut().push_back(window); self.focus_window(self.windows().len().saturating_sub(1)); + let focused_window_idx = self.focused_window_idx(); + + for (i, window) in self.windows().iter().enumerate() { + if i != focused_window_idx { + window.hide(); + } + } } #[tracing::instrument(skip(self))] diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index 44db8376..f2a4db0b 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -346,6 +346,8 @@ impl WindowManager { .ok_or_else(|| anyhow!("there is no focused container"))? .add_window(window); self.update_focused_workspace(true, false)?; + + stackbar_manager::send_notification(); } } } @@ -546,6 +548,8 @@ impl WindowManager { )?; } } + + stackbar_manager::send_notification(); } } }