mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-24 10:21:21 +01:00
fix(wm): ensure borders are drawn w/ stackbar
This commit fixes a small regression and ensures that the active window border, when enabled, will be drawn as expected when a container stack has a stackbar active.
This commit is contained in:
@@ -71,10 +71,20 @@ impl WindowManager {
|
||||
if BORDER_ENABLED.load(Ordering::SeqCst) {
|
||||
if let WindowManagerEvent::FocusChange(_, window) = event {
|
||||
let border_window = Border::from(BORDER_HWND.load(Ordering::SeqCst));
|
||||
|
||||
if should_manage {
|
||||
border_window.set_position(*window, true)?;
|
||||
} else {
|
||||
border_window.hide()?;
|
||||
let mut stackbar = false;
|
||||
if let Ok(class) = window.class() {
|
||||
if class == "komorebi_stackbar" {
|
||||
stackbar = true;
|
||||
}
|
||||
}
|
||||
|
||||
if !stackbar {
|
||||
border_window.hide()?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +400,12 @@ impl Window {
|
||||
// If not allowing cloaked windows, we need to ensure the window is not cloaked
|
||||
(false, false) => {
|
||||
if let (Ok(title), Ok(exe_name), Ok(class), Ok(path)) = (self.title(), self.exe(), self.class(), self.path()) {
|
||||
return Ok(window_is_eligible(&title, &exe_name, &class, &path, &self.style()?, &self.ex_style()?, event));
|
||||
// calls for styles can fail quite often for events with windows that aren't really "windows"
|
||||
// since we have moved up calls of should_manage to the beginning of the process_event handler,
|
||||
// we should handle failures here gracefully to be able to continue the execution of process_event
|
||||
if let (Ok(style), Ok(ex_style)) = (&self.style(), &self.ex_style()) {
|
||||
return Ok(window_is_eligible(&title, &exe_name, &class, &path, style, ex_style, event));
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
Reference in New Issue
Block a user