diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-11-04 11:15:39 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-11-04 11:19:28 +0200 |
commit | cfce8de0b59e06c6e7fcf3579557525aa9062534 (patch) | |
tree | cdc89eab38fdf06d97a75f9d6bed8eeb2a6f7600 | |
parent | 121cead38e5ea84ec22139df02eee56d822290b7 (diff) |
Fix .app bundle crash on macOS
-rw-r--r-- | platform/osx/os_osx.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 77bf8a8146..b0fdd010ab 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -328,14 +328,14 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto //_GodotPlatformSetCursorMode(window, window->cursorMode); [OS_OSX::singleton->context update]; - get_mouse_pos( - [OS_OSX::singleton->window_object mouseLocationOutsideOfEventStream], - [OS_OSX::singleton->window_view backingScaleFactor]); - if (OS_OSX::singleton->input) + if (OS_OSX::singleton->get_main_loop()) { + get_mouse_pos( + [OS_OSX::singleton->window_object mouseLocationOutsideOfEventStream], + [OS_OSX::singleton->window_view backingScaleFactor]); OS_OSX::singleton->input->set_mouse_position(Point2(mouse_x, mouse_y)); - if (OS_OSX::singleton->get_main_loop()) OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); + } } - (void)windowDidResignKey:(NSNotification *)notification { |