diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-04-16 09:25:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-16 09:25:00 +0200 |
commit | 0a40ac3246459c9d72ad217bd008ac3e900a6f15 (patch) | |
tree | e6daa5833e23ace439eea2feb0de1cbff63df763 /platform/osx | |
parent | 2c0c1e3c16ee0a5dc853affa33cb958bd132a999 (diff) | |
parent | 1bae73d7d060eeb9531fc5ba46de5d31dc7073c7 (diff) |
Merge pull request #28058 from guilhermefelipecgs/fix_28024
Add Input::get_current_cursor_shape
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/os_osx.h | 1 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index dfe7b27bd0..125a88ab6d 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -172,6 +172,7 @@ public: virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false); virtual void set_cursor_shape(CursorShape p_shape); + virtual CursorShape get_cursor_shape() const; virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot); virtual void set_mouse_show(bool p_show); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 4bbe30a7d1..5a4c0593bc 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -712,8 +712,6 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) { 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_EXIT); - if (OS_OSX::singleton->input) - OS_OSX::singleton->input->set_mouse_in_window(false); } - (void)mouseEntered:(NSEvent *)event { @@ -721,8 +719,6 @@ 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) - OS_OSX::singleton->input->set_mouse_in_window(true); OS::CursorShape p_shape = OS_OSX::singleton->cursor_shape; OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX; @@ -1696,6 +1692,11 @@ void OS_OSX::set_cursor_shape(CursorShape p_shape) { cursor_shape = p_shape; } +OS::CursorShape OS_OSX::get_cursor_shape() const { + + return cursor_shape; +} + void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) { if (p_cursor.is_valid()) { Ref<Texture> texture = p_cursor; |