File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -2112,20 +2112,19 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
2112
2112
}
2113
2113
}
2114
2114
2115
+ // NSTrackingArea is how Cocoa tells you when the mouse cursor has entered or
2116
+ // left certain regions. We put one over our entire window so we know when
2117
+ // it has "mouse focus."
2115
2118
- (void )updateTrackingAreas
2116
2119
{
2117
2120
[super updateTrackingAreas ];
2118
2121
2119
- if (@available (macOS 12.0 , *)) {
2120
- // we (currently) use the tracking areas as a workaround for older macOSes, but we might be safe everywhere...
2121
- } else {
2122
- SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)_sdlWindow->internal ;
2123
- if (_trackingArea) {
2124
- [self removeTrackingArea: _trackingArea];
2125
- }
2126
- _trackingArea = [[NSTrackingArea alloc ] initWithRect: [self bounds ] options: NSTrackingMouseEnteredAndExited|NSTrackingActiveAlways owner: windata.listener userInfo: nil ];
2127
- [self addTrackingArea: _trackingArea];
2122
+ SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)_sdlWindow->internal ;
2123
+ if (_trackingArea) {
2124
+ [self removeTrackingArea: _trackingArea];
2128
2125
}
2126
+ _trackingArea = [[NSTrackingArea alloc ] initWithRect: [self bounds ] options: NSTrackingMouseEnteredAndExited|NSTrackingActiveAlways owner: windata.listener userInfo: nil ];
2127
+ [self addTrackingArea: _trackingArea];
2129
2128
}
2130
2129
@end
2131
2130
You can’t perform that action at this time.
0 commit comments