Properly fix SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH on macOS VTRenderer

This commit is contained in:
Cameron Gutman
2020-05-06 22:17:22 -07:00
parent 51c4ecc879
commit f30c11ddf4

View File

@@ -16,6 +16,19 @@
#import <dispatch/dispatch.h>
#import <Metal/Metal.h>
@interface VTView : NSView
- (NSView *)hitTest:(NSPoint)point;
@end
@implementation VTView
- (NSView *)hitTest:(NSPoint)point {
Q_UNUSED(point);
return nil;
}
@end
class VTRenderer : public IFFmpegRenderer
{
public:
@@ -398,7 +411,7 @@ public:
// SDL adds its own content view to listen for events.
// We need to add a subview for our display layer.
NSView* contentView = info.info.cocoa.window.contentView;
m_StreamView = [[NSView alloc] initWithFrame:contentView.bounds];
m_StreamView = [[VTView alloc] initWithFrame:contentView.bounds];
m_DisplayLayer = [[AVSampleBufferDisplayLayer alloc] init];
m_DisplayLayer.bounds = m_StreamView.bounds;