Skip to content

Commit 544ab4c

Browse files
committed
macOS: Process first click event without requiring focus
This improves the user experience for macOS users, to be consistent with other macOS applications. When a Godot window is not focused, and the user clicks on the window, the event is forwarded to the receiving control to be processed as if the window was already focused.
1 parent 19bb187 commit 544ab4c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

platform/macos/godot_content_view.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ - (void)displayLayer:(CALayer *)layer {
6868

6969
@implementation GodotContentView
7070

71+
- (BOOL)acceptsFirstMouse:(NSEvent *)event {
72+
return YES;
73+
}
74+
7175
- (void)setFrameSize:(NSSize)newSize {
7276
DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
7377
if (ds && ds->has_window(window_id)) {

0 commit comments

Comments
 (0)