From 1b6de9a98749a7189e2ad1530fd460c1a14d9e09 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 5 Sep 2020 15:01:45 -0700 Subject: [PATCH] Fix SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH=1 on Metal windows SDL_cocoametalview was consuming the first click rather than passing it through to the SDLView underneath which overrides [NSView acceptsFirstMouse] based on the user's SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH preference. --- src/video/cocoa/SDL_cocoametalview.h | 1 + src/video/cocoa/SDL_cocoametalview.m | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/video/cocoa/SDL_cocoametalview.h b/src/video/cocoa/SDL_cocoametalview.h index 69c4fea70..c173a0e7d 100644 --- a/src/video/cocoa/SDL_cocoametalview.h +++ b/src/video/cocoa/SDL_cocoametalview.h @@ -48,6 +48,7 @@ windowID:(Uint32)windowID; - (void)updateDrawableSize; +- (NSView *)hitTest:(NSPoint)point; /* Override superclass tag so this class can set it. */ @property (assign, readonly) NSInteger tag; diff --git a/src/video/cocoa/SDL_cocoametalview.m b/src/video/cocoa/SDL_cocoametalview.m index 605ecd370..291c55279 100644 --- a/src/video/cocoa/SDL_cocoametalview.m +++ b/src/video/cocoa/SDL_cocoametalview.m @@ -123,6 +123,10 @@ SDL_MetalViewEventWatch(void *userdata, SDL_Event *event) metalLayer.drawableSize = NSSizeToCGSize(backingSize); } +- (NSView *)hitTest:(NSPoint)point { + return nil; +} + @end SDL_MetalView