Skip to content

Commit

Permalink
fix(wm): correct logic for foreground access retry
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Jan 21, 2023
1 parent 67e0914 commit f8120f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions komorebi/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ impl Window {
// If this still doesn't work then maybe try https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-locksetforegroundwindow
if !tried_resetting_foreground_access {
let process_id = WindowsApi::current_process_id();
WindowsApi::allow_set_foreground_window(process_id)?;
tried_resetting_foreground_access = true;
if WindowsApi::allow_set_foreground_window(process_id).is_ok() {
tried_resetting_foreground_access = true;
}
}
}
};
Expand Down

0 comments on commit f8120f6

Please sign in to comment.