fix: take foreground visibility into account for isVisible on macOS (#17492)

This commit is contained in:
trop[bot]
2019-03-20 20:40:52 -07:00
committed by Shelley Vohr
parent f005ac8d8b
commit 98180568f2

View File

@@ -585,7 +585,12 @@ void NativeWindowMac::Hide() {
}
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() {