From 839f8c9bf769ea341a179a1983490871d1ef193b Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 15 Apr 2022 08:28:04 -0700 Subject: [PATCH] fix(windows): remove hwnd val checks on 0.35 Small commit to temporarily handle a regression introduced by my changes when upgrading from 0.34 to 0.35. Checking for a 0 HWND value results in an Err being propagated in fns like GetForegroundWindow, while the error message just reads "The operation completed successfully. (os error 0)". This behaviour was causing regressions in features such as window floating which seems to be resolved by removing the 0 HWND check. --- komorebi/src/windows_api.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index 33935d94..b18277c7 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -130,11 +130,7 @@ macro_rules! impl_process_windows_crate_integer_wrapper_result { $( impl ProcessWindowsCrateResult<$deref> for $input { fn process(self) -> Result<$deref> { - if self.0 == 0 { - Ok(self.0) - } else { - Err(std::io::Error::last_os_error().into()) - } + Ok(self.0) } } )+