Skip to content

Commit

Permalink
Fix SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH=1 on Metal windows
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cgutman committed Sep 5, 2020
1 parent 244d0ad commit 1b6de9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/cocoa/SDL_cocoametalview.h
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/video/cocoa/SDL_cocoametalview.m
Expand Up @@ -123,6 +123,10 @@ - (void)updateDrawableSize
metalLayer.drawableSize = NSSizeToCGSize(backingSize);
}

- (NSView *)hitTest:(NSPoint)point {
return nil;
}

@end

SDL_MetalView
Expand Down

0 comments on commit 1b6de9a

Please sign in to comment.