summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-30 17:01:05 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-06-30 17:59:30 +0300
commita07578592b86d83eb4134a726efc0746afe543b1 (patch)
tree130f015939b31606c6ba2d9c7799f85445c5425e
parent5f2295f2dfdbf1ac4e63b562e4cef71f2fda4036 (diff)
[macOS] Add application become/resign active notifications.
-rw-r--r--platform/osx/display_server_osx.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index 920fd24c4a..93f6e3540a 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -197,6 +197,18 @@ static NSCursor *_cursorFromSelector(SEL selector, SEL fallback = nil) {
}
}
+- (void)applicationDidResignActive:(NSNotification *)notification {
+ if (OS_OSX::get_singleton()->get_main_loop()) {
+ OS_OSX::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_OUT);
+ }
+}
+
+- (void)applicationDidBecomeActive:(NSNotification *)notification {
+ if (OS_OSX::get_singleton()->get_main_loop()) {
+ OS_OSX::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_APPLICATION_FOCUS_IN);
+ }
+}
+
- (void)globalMenuCallback:(id)sender {
if (![sender representedObject])
return;