Skip to content

Commit

Permalink
refactor: check isMainWindow as well
Browse files Browse the repository at this point in the history
  • Loading branch information
henry40408 committed Aug 17, 2022
1 parent 7e3781c commit d46d320
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/platform_impl/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ impl UnownedWindow {
pub fn is_focused(&self) -> bool {
unsafe {
let is_key_window: BOOL = msg_send![*self.ns_window, isKeyWindow];
is_key_window == YES
let is_main_window: BOOL = msg_send![*self.ns_window, isMainWindow];
is_key_window == YES && is_main_window == YES
}
}

Expand Down

0 comments on commit d46d320

Please sign in to comment.