summaryrefslogtreecommitdiffstats
path: root/platform/macos/godot_window_delegate.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/godot_window_delegate.mm')
-rw-r--r--platform/macos/godot_window_delegate.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/macos/godot_window_delegate.mm b/platform/macos/godot_window_delegate.mm
index 1756f2d676..e359630d1d 100644
--- a/platform/macos/godot_window_delegate.mm
+++ b/platform/macos/godot_window_delegate.mm
@@ -356,4 +356,13 @@
}
}
+- (void)windowDidChangeOcclusionState:(NSNotification *)notification {
+ DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
+ if (!ds || !ds->has_window(window_id)) {
+ return;
+ }
+ DisplayServerMacOS::WindowData &wd = ds->get_window(window_id);
+ wd.is_visible = ([wd.window_object occlusionState] & NSWindowOcclusionStateVisible) && [wd.window_object isVisible];
+}
+
@end