diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index d0f40bf4..698c5805 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -11,6 +11,7 @@ use parking_lot::Mutex; use komorebi_core::OperationDirection; use komorebi_core::Rect; use komorebi_core::Sizing; +use komorebi_core::StackbarLabel; use komorebi_core::WindowContainerBehaviour; use crate::border_manager; @@ -23,6 +24,7 @@ use crate::window::RuleDebug; use crate::window_manager::WindowManager; use crate::window_manager_event::WindowManagerEvent; use crate::windows_api::WindowsApi; +use crate::winevent::WinEvent; use crate::workspace_reconciliator; use crate::workspace_reconciliator::ALT_TAB_HWND; use crate::workspace_reconciliator::ALT_TAB_HWND_INSTANT; @@ -31,6 +33,7 @@ use crate::NotificationEvent; use crate::DATA_DIR; use crate::HIDDEN_HWNDS; use crate::REGEX_IDENTIFIERS; +use crate::STACKBAR_LABEL; use crate::TRAY_AND_MULTI_WINDOW_IDENTIFIERS; #[tracing::instrument] @@ -268,6 +271,23 @@ impl WindowManager { WindowManagerEvent::Show(_, window) | WindowManagerEvent::Manage(window) | WindowManagerEvent::Uncloak(_, window) => { + if matches!( + event, + WindowManagerEvent::Show(WinEvent::ObjectNameChange, _) + ) { + if matches!(STACKBAR_LABEL.load(), StackbarLabel::Title) { + for m in self.monitors() { + for ws in m.workspaces() { + if let Some(container) = ws.container_for_window(window.hwnd) { + if let Some(stackbar) = container.stackbar() { + stackbar.update(container.windows(), window.hwnd)?; + } + } + } + } + } + } + let focused_monitor_idx = self.focused_monitor_idx(); let focused_workspace_idx = self.focused_workspace_idx_for_monitor_idx(focused_monitor_idx)?;