diff options
| author | Guilherme Felipe | 2018-05-09 19:49:45 -0300 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-05-13 21:51:25 +0200 |
| commit | 2fa54c1df6771b4cd4ac141309a7cb0dd2675882 (patch) | |
| tree | a699ddf72185bc91cb9ee4b6b6ef2d23195eb89f | |
| parent | 7f65584f28969362f90d3cc0dd5c10850fac7abf (diff) | |
| download | godot-2fa54c1df6771b4cd4ac141309a7cb0dd2675882.tar.gz godot-2fa54c1df6771b4cd4ac141309a7cb0dd2675882.tar.zst godot-2fa54c1df6771b4cd4ac141309a7cb0dd2675882.zip | |
Fix custom cursor disappearing on osx
(cherry picked from commit 48f9e6a05b928bdd9085827c4f6b341f960be75e)
| -rw-r--r-- | platform/osx/os_osx.mm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 896114980..ca785698f 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -539,7 +539,9 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; } - (void)cursorUpdate:(NSEvent *)event { - //setModeCursor(window, window->cursorMode); + OS::CursorShape p_shape = OS_OSX::singleton->cursor_shape; + OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX; + OS_OSX::singleton->set_cursor_shape(p_shape); } static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { @@ -654,11 +656,12 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { return; if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode != OS::MOUSE_MODE_CAPTURED) OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER); - if (OS_OSX::singleton->input) { + if (OS_OSX::singleton->input) OS_OSX::singleton->input->set_mouse_in_window(true); - OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX; - OS_OSX::singleton->set_cursor_shape(OS::CURSOR_ARROW); - } + + OS::CursorShape p_shape = OS_OSX::singleton->cursor_shape; + OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX; + OS_OSX::singleton->set_cursor_shape(p_shape); } - (void)magnifyWithEvent:(NSEvent *)event { |
