ソースを参照

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.
Cameron Gutman 4 年 前
コミット
1b6de9a987

+ 1 - 0
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;

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