|
|
@@ -2112,20 +2112,19 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// NSTrackingArea is how Cocoa tells you when the mouse cursor has entered or
|
|
|
+// left certain regions. We put one over our entire window so we know when
|
|
|
+// it has "mouse focus."
|
|
|
- (void)updateTrackingAreas
|
|
|
{
|
|
|
[super updateTrackingAreas];
|
|
|
|
|
|
- if (@available(macOS 12.0, *)) {
|
|
|
- // we (currently) use the tracking areas as a workaround for older macOSes, but we might be safe everywhere...
|
|
|
- } else {
|
|
|
- SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)_sdlWindow->internal;
|
|
|
- if (_trackingArea) {
|
|
|
- [self removeTrackingArea:_trackingArea];
|
|
|
- }
|
|
|
- _trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] options:NSTrackingMouseEnteredAndExited|NSTrackingActiveAlways owner:windata.listener userInfo:nil];
|
|
|
- [self addTrackingArea:_trackingArea];
|
|
|
+ SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)_sdlWindow->internal;
|
|
|
+ if (_trackingArea) {
|
|
|
+ [self removeTrackingArea:_trackingArea];
|
|
|
}
|
|
|
+ _trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] options:NSTrackingMouseEnteredAndExited|NSTrackingActiveAlways owner:windata.listener userInfo:nil];
|
|
|
+ [self addTrackingArea:_trackingArea];
|
|
|
}
|
|
|
@end
|
|
|
|