From 4334fff23001fcb2d2299ffdfdcf5afcfbdd04a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:59:27 +0200 Subject: [PATCH] [macOS] Add missing "move" system cursor. --- platform/macos/SCsub | 1 + platform/macos/display_server_macos.mm | 3 +- platform/macos/godot_core_cursor.h | 45 ++++++++++++++++++++++++++ platform/macos/godot_core_cursor.mm | 43 ++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 platform/macos/godot_core_cursor.h create mode 100644 platform/macos/godot_core_cursor.mm diff --git a/platform/macos/SCsub b/platform/macos/SCsub index 30bf5c6f387..062d340e70a 100644 --- a/platform/macos/SCsub +++ b/platform/macos/SCsub @@ -17,6 +17,7 @@ files = [ "embedded_gl_manager.mm", "godot_button_view.mm", "godot_content_view.mm", + "godot_core_cursor.mm", "godot_status_item.mm", "godot_window_delegate.mm", "godot_window.mm", diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 1c2ac0eb2c6..c6eb9a5647f 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -34,6 +34,7 @@ #import "godot_application_delegate.h" #import "godot_button_view.h" #import "godot_content_view.h" +#import "godot_core_cursor.h" #import "godot_menu_delegate.h" #import "godot_menu_item.h" #import "godot_open_save_delegate.h" @@ -3024,7 +3025,7 @@ void DisplayServerMacOS::cursor_update_shape() { [_cursor_from_selector(@selector(_windowResizeNorthWestSouthEastCursor)) set]; break; case CURSOR_MOVE: - [[NSCursor arrowCursor] set]; + [[[GodotCoreCursor alloc] initWithType:GDCoreCursorWindowMove] set]; break; case CURSOR_VSPLIT: [[NSCursor resizeUpDownCursor] set]; diff --git a/platform/macos/godot_core_cursor.h b/platform/macos/godot_core_cursor.h new file mode 100644 index 00000000000..c35c70f213f --- /dev/null +++ b/platform/macos/godot_core_cursor.h @@ -0,0 +1,45 @@ +/**************************************************************************/ +/* godot_core_cursor.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#pragma once + +#import +#import + +constexpr int32_t GDCoreCursorWindowMove = 39; + +// Expose private interface for CoreCursor. +@interface GodotCoreCursor : NSCursor + +@property(readonly, nonatomic) int32_t _coreCursorType; + +- (id)initWithType:(int32_t)type; + +@end diff --git a/platform/macos/godot_core_cursor.mm b/platform/macos/godot_core_cursor.mm new file mode 100644 index 00000000000..73d080be993 --- /dev/null +++ b/platform/macos/godot_core_cursor.mm @@ -0,0 +1,43 @@ +/**************************************************************************/ +/* godot_core_cursor.mm */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#import "godot_core_cursor.h" + +@implementation GodotCoreCursor +@synthesize _coreCursorType = _type; + +- (id)initWithType:(int32_t)type { + if ((self = [super init])) { + _type = type; + } + return self; +} + +@end