Skip to content

Commit

Permalink
fix(wm): apply window based offsets to monocles
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
LGUG2Z committed Jul 24, 2024
1 parent 780635c commit c367967
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions komorebi/src/transparency_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
}
}

Expand Down
3 changes: 2 additions & 1 deletion komorebi/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c367967

Please sign in to comment.