Skip to content

Commit

Permalink
fix(wm): restart bm and wsr notif handlers on fail
Browse files Browse the repository at this point in the history
This commit ensures that if and when either the border_manager or
workspace_reconciliator notification handlers crash in their respective
threads, they will be restarted instead of killing the whole thread.

This is acheived via a loop running in the spawned threads of both
listeners, which will report whichever error killed the notification
handler functions.

Clippy annotations to deny expect and unwrap calls have been added to
these two modules.

Calls to DestroyWindow for expired borders were sporadically failing in
unpredictable circumstances, so these have been switched out with calls
to CloseWindow which has been working well so far with the stackbar
feature.
  • Loading branch information
LGUG2Z committed May 15, 2024
1 parent a4dd5fc commit 87b1ab9
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 173 deletions.
3 changes: 2 additions & 1 deletion komorebi/src/border_manager/border.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub extern "system" fn border_hwnds(hwnd: HWND, lparam: LPARAM) -> BOOL {
true.into()
}

#[derive(Debug)]
pub struct Border {
pub hwnd: isize,
}
Expand Down Expand Up @@ -116,7 +117,7 @@ impl Border {
}

pub fn destroy(&self) -> color_eyre::Result<()> {
WindowsApi::destroy_window(self.hwnd())
WindowsApi::close_window(self.hwnd())
}

pub fn update(&self, rect: &Rect) -> color_eyre::Result<()> {
Expand Down
Loading

0 comments on commit 87b1ab9

Please sign in to comment.