From 192af6751b368cf43cf3e46c4bb4fa272035e6c3 Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Sat, 7 Dec 2024 12:55:01 +0000 Subject: [PATCH] fix(border): stop removing borders on wrong monitors --- komorebi/src/border_manager/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/komorebi/src/border_manager/mod.rs b/komorebi/src/border_manager/mod.rs index 6d2f087bf..13326535e 100644 --- a/komorebi/src/border_manager/mod.rs +++ b/komorebi/src/border_manager/mod.rs @@ -369,9 +369,11 @@ pub fn handle_notifications(wm: Arc>) -> color_eyre::Result continue 'monitors; } - let is_maximized = WindowsApi::is_zoomed( - WindowsApi::foreground_window().unwrap_or_default(), - ); + let foreground_hwnd = WindowsApi::foreground_window().unwrap_or_default(); + let foreground_monitor_id = + WindowsApi::monitor_from_window(foreground_hwnd); + let is_maximized = foreground_monitor_id == m.id() + && WindowsApi::is_zoomed(foreground_hwnd); if is_maximized { let mut to_remove = vec![];