diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-06-30 22:14:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 22:14:52 +0200 |
commit | e820a73f58d7e25562ff2be75e975ec517a6c35b (patch) | |
tree | ec1a75ae567c82ffa5c8d4ffbdc918156629fe62 | |
parent | 5187d25eb207539d1b6eacc9ea2e9a9ec9a7d87a (diff) | |
parent | a07578592b86d83eb4134a726efc0746afe543b1 (diff) |
Merge pull request #39988 from bruvzg/macos_app_active_notifications
[macOS] Add application become/resign active notifications.
-rw-r--r-- | platform/osx/display_server_osx.mm | 12 |
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; |