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.
This commit is contained in:
Cameron Gutman 2020-09-05 15:01:45 -07:00
parent 244d0ad854
commit 1b6de9a987
2 changed files with 5 additions and 0 deletions

View File

@ -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;

View File

@ -123,6 +123,10 @@ SDL_MetalViewEventWatch(void *userdata, SDL_Event *event)
metalLayer.drawableSize = NSSizeToCGSize(backingSize);
}
- (NSView *)hitTest:(NSPoint)point {
return nil;
}
@end
SDL_MetalView