From f7797bf1b347f7a2eceaaad68e94fc87c3936850 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 23 Jun 2021 10:51:01 +0300 Subject: [PATCH] [macOS] Fix custom mouse cursor not set after mouse mode change. --- platform/osx/display_server_osx.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index ec51ec78d302..4a672a4b17c6 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -2120,6 +2120,12 @@ - (BOOL)canBecomeMainWindow { ignore_warp = true; warp_events.clear(); mouse_mode = p_mode; + + if (mouse_mode == MOUSE_MODE_VISIBLE || mouse_mode == MOUSE_MODE_CONFINED) { + CursorShape p_shape = cursor_shape; + cursor_shape = DisplayServer::CURSOR_MAX; + cursor_set_shape(p_shape); + } } DisplayServer::MouseMode DisplayServerOSX::mouse_get_mode() const {