mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-09-18 15:51:29 +02:00
fix(wm): restart bm and wsr notif handlers on fail
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.
This commit is contained in:
@@ -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,
|
||||
}
|
||||
@@ -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<()> {
|
||||
|
||||
Reference in New Issue
Block a user