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).
This commit is contained in:
LGUG2Z
2024-07-24 10:46:55 -07:00
parent 780635c8ef
commit c367967301
2 changed files with 7 additions and 8 deletions

View File

@@ -111,13 +111,11 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> 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}"
)
}
}

View File

@@ -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(