From 544ab4ccab18ee8a789be7e8ee7d41b0cb866475 Mon Sep 17 00:00:00 2001 From: Stuart Carnie Date: Tue, 13 May 2025 05:21:51 +1000 Subject: [PATCH] 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. --- platform/macos/godot_content_view.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/macos/godot_content_view.mm b/platform/macos/godot_content_view.mm index 9259d232be..5bbb20cc23 100644 --- a/platform/macos/godot_content_view.mm +++ b/platform/macos/godot_content_view.mm @@ -68,6 +68,10 @@ @implementation GodotContentView +- (BOOL)acceptsFirstMouse:(NSEvent *)event { + return YES; +} + - (void)setFrameSize:(NSSize)newSize { DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton(); if (ds && ds->has_window(window_id)) {