From 26a18adeb40a40d1a7ce2ab0317deb75c0ce16d0 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 27 Aug 2022 15:00:20 -0700 Subject: [PATCH] fix(wm): restore monocle border on ws change This commit ensures that when navigating away from and then back to a workspace with a monocle window container, that the monocle window container will be properly focused when navigating back, including having the focus of the active window border. fix #219 --- komorebi/src/process_event.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index 1ce3ddd2..a295eec4 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -503,6 +503,12 @@ impl WindowManager { WindowsApi::raise_window(border.hwnd())?; }; + if let Some(monocle_container) = self.focused_workspace()?.monocle_container() { + if let Some(window) = monocle_container.focused_window() { + target_window = Option::from(*window); + } + } + if target_window.is_none() { match self.focused_container() { // if there is no focused container, the desktop is empty