Skip to content

Commit

Permalink
fix: take foreground visibility into account for isVisible on macOS (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
trop[bot] authored and codebytere committed Mar 21, 2019
1 parent a1c1012 commit 27b4335
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion atom/browser/native_window_mac.mm
Expand Up @@ -576,7 +576,12 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
}

bool NativeWindowMac::IsVisible() {
return [window_ isVisible];
bool occluded = [window_ occlusionState] == NSWindowOcclusionStateVisible;

// For a window to be visible, it must be visible to the user in the
// foreground of the app, which means that it should not be minimized or
// occluded
return [window_ isVisible] && !occluded && !IsMinimized();
}

bool NativeWindowMac::IsEnabled() {
Expand Down

0 comments on commit 27b4335

Please sign in to comment.