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
This commit is contained in:
LGUG2Z
2024-08-06 16:41:50 -07:00
parent ff653e78af
commit 13e2cbc7a1
+4 -1
View File
@@ -151,7 +151,10 @@ impl WindowManagerEvent {
) )
.is_some(); .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)) Option::from(Self::Show(winevent, window))
} else { } else {
Option::from(Self::TitleUpdate(winevent, window)) Option::from(Self::TitleUpdate(winevent, window))