Skip to content

Commit

Permalink
mac: is_foreground_window
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKnauth committed May 23, 2024
1 parent d174e43 commit 87d12b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion druid-shell/src/backend/mac/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,11 @@ impl WindowHandle {
}

pub fn is_foreground_window(&self) -> bool {
true
unsafe {
let application: id = msg_send![class![NSRunningApplication], currentApplication];
let is_active: BOOL = msg_send![application, isActive];
is_active != NO
}
}

pub fn get_window_state(&self) -> WindowState {
Expand Down

0 comments on commit 87d12b9

Please sign in to comment.