Merge pull request #23393 from marcelofg55/osx_crash

Fix OS X crash when running as .app
This commit is contained in:
Rémi Verschelde 2018-10-31 09:54:11 +01:00 committed by GitHub
commit 16f066c8f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -331,7 +331,8 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto
get_mouse_pos( get_mouse_pos(
[OS_OSX::singleton->window_object mouseLocationOutsideOfEventStream], [OS_OSX::singleton->window_object mouseLocationOutsideOfEventStream],
[OS_OSX::singleton->window_view backingScaleFactor]); [OS_OSX::singleton->window_view backingScaleFactor]);
OS_OSX::singleton->input->set_mouse_position(Point2(mouse_x, mouse_y)); if (OS_OSX::singleton->input)
OS_OSX::singleton->input->set_mouse_position(Point2(mouse_x, mouse_y));
if (OS_OSX::singleton->get_main_loop()) if (OS_OSX::singleton->get_main_loop())
OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);