Merge pull request #113186 from bruvzg/macos_movec

[macOS] Add missing "move" system cursor.
This commit is contained in:
Rémi Verschelde
2025-11-27 21:48:17 +01:00
4 changed files with 91 additions and 1 deletions

View File

@ -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",

View File

@ -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];

View File

@ -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 <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
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

View File

@ -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