From 13e2cbc7a1a4bb6f0c29227ec0461ae6e83f96d2 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Tue, 6 Aug 2024 16:41:50 -0700 Subject: [PATCH] fix(wm): exclude minimized hwnds from show event This commit ensures that a WindowManagerEvent::Show will not be triggered when a WinEvent::ObjectNameChange is received for an application in the object_name_change_on_launch whitelist. This notably impacts Firefox when the window title changes while the application is minimized (for example, on a page with YouTube autoplay enabled). fix #941 --- komorebi/src/window_manager_event.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/komorebi/src/window_manager_event.rs b/komorebi/src/window_manager_event.rs index 01d0e239..8f7fb36f 100644 --- a/komorebi/src/window_manager_event.rs +++ b/komorebi/src/window_manager_event.rs @@ -151,7 +151,10 @@ impl WindowManagerEvent { ) .is_some(); - if should_trigger_show { + // should not trigger show on minimized windows, for example when firefox sends + // this message due to youtube autoplay changing the window title + // https://github.com/LGUG2Z/komorebi/issues/941 + if should_trigger_show && !window.is_miminized() { Option::from(Self::Show(winevent, window)) } else { Option::from(Self::TitleUpdate(winevent, window))