Преглед изворни кода

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 пре 5 година
родитељ
комит
1b6de9a987
2 измењених фајлова са 5 додато и 0 уклоњено
  1. 1 0
      src/video/cocoa/SDL_cocoametalview.h
  2. 4 0
      src/video/cocoa/SDL_cocoametalview.m

+ 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