From c3679673012f8ca49db945ae2df4847e79eebd6c Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Wed, 24 Jul 2024 10:46:55 -0700 Subject: [PATCH] fix(wm): apply window based offsets to monocles This commit ensures that when a window_based_work_area_offset is set, and the window limit is greater than 0, the offset will be applied to monocle containers on a workspace (unless an override is specified for that workspace). --- komorebi/src/transparency_manager.rs | 12 +++++------- komorebi/src/workspace.rs | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/komorebi/src/transparency_manager.rs b/komorebi/src/transparency_manager.rs index 23248406..f5aed700 100644 --- a/komorebi/src/transparency_manager.rs +++ b/komorebi/src/transparency_manager.rs @@ -111,13 +111,11 @@ pub fn handle_notifications(wm: Arc>) -> color_eyre::Result "failed to make monocle window {hwnd} opaque: {error}" ) } - } else { - if let Err(error) = window.transparent() { - let hwnd = window.hwnd; - tracing::error!( - "failed to make monocle window {hwnd} transparent: {error}" - ) - } + } else if let Err(error) = window.transparent() { + let hwnd = window.hwnd; + tracing::error!( + "failed to make monocle window {hwnd} transparent: {error}" + ) } } diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 54752863..45bce295 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -267,7 +267,8 @@ impl Workspace { }, ); - if self.containers().len() <= window_based_work_area_offset_limit as usize + if (self.containers().len() <= window_based_work_area_offset_limit as usize + || self.monocle_container().is_some() && window_based_work_area_offset_limit > 0) && self.apply_window_based_work_area_offset { adjusted_work_area = window_based_work_area_offset.map_or_else(