fix(transparency): handle multi-monitor monocles

This commit ensures that transparency will be set accordingly when focus
moves to and from monocle containers on multi-monitor setups.
This commit is contained in:
LGUG2Z
2024-07-24 10:37:40 -07:00
parent d5bec7afa4
commit 780635c8ef

View File

@@ -104,9 +104,20 @@ pub fn handle_notifications(wm: Arc<Mutex<WindowManager>>) -> color_eyre::Result
// Monocle container is never transparent
if let Some(monocle) = ws.monocle_container() {
if let Some(window) = monocle.focused_window() {
if let Err(error) = window.opaque() {
let hwnd = window.hwnd;
tracing::error!("failed to make monocle window {hwnd} opaque: {error}")
if monitor_idx == focused_monitor_idx {
if let Err(error) = window.opaque() {
let hwnd = window.hwnd;
tracing::error!(
"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}"
)
}
}
}