Răsfoiți Sursa

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.
Stuart Carnie 3 luni în urmă
părinte
comite
544ab4ccab
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      platform/macos/godot_content_view.mm

+ 4 - 0
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)) {