From 1cd28652aadd5f664a6c2fc37dde60bfe016cef7 Mon Sep 17 00:00:00 2001 From: alex-ds13 <145657253+alex-ds13@users.noreply.github.com> Date: Fri, 31 Jan 2025 13:23:51 +0000 Subject: [PATCH] feat(wm): keep track of known_hwnds on wm --- komorebi/src/process_event.rs | 2 ++ komorebi/src/static_config.rs | 1 + komorebi/src/window_manager.rs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index 087d58e7..b71f3bb4 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -751,6 +751,8 @@ impl WindowManager { serde_json::to_writer_pretty(&file, &known_hwnds)?; + self.known_hwnds = known_hwnds; + notify_subscribers( Notification { event: NotificationEvent::WindowManager(event), diff --git a/komorebi/src/static_config.rs b/komorebi/src/static_config.rs index 0c5aefcf..9d11c5e3 100644 --- a/komorebi/src/static_config.rs +++ b/komorebi/src/static_config.rs @@ -1207,6 +1207,7 @@ impl StaticConfig { pending_move_op: Arc::new(None), already_moved_window_handles: Arc::new(Mutex::new(HashSet::new())), uncloack_to_ignore: 0, + known_hwnds: Vec::new(), }; match value.focus_follows_mouse { diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index 944b1673..b7973c1b 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -117,6 +117,7 @@ pub struct WindowManager { pub pending_move_op: Arc>, pub already_moved_window_handles: Arc>>, pub uncloack_to_ignore: usize, + pub known_hwnds: Vec, } #[allow(clippy::struct_excessive_bools)] @@ -364,6 +365,7 @@ impl WindowManager { pending_move_op: Arc::new(None), already_moved_window_handles: Arc::new(Mutex::new(HashSet::new())), uncloack_to_ignore: 0, + known_hwnds: Vec::new(), }) }