cocoa: Check for duplicate proximity events.

Fixes #12137.
This commit is contained in:
Ryan C. Gordon
2025-10-20 15:55:24 -04:00
parent 3669920fdd
commit 91a5598283

View File

@@ -84,7 +84,12 @@ static void Cocoa_HandlePenProximityEvent(SDL_CocoaWindowData *_data, NSEvent *e
return; // we ignore other things, which hopefully is right.
}
Cocoa_PenHandle *handle = (Cocoa_PenHandle *) SDL_calloc(1, sizeof (*handle));
Cocoa_PenHandle *handle = Cocoa_FindPenByDeviceID(devid, toolid);
if (handle) {
return; // already have this one.
}
handle = (Cocoa_PenHandle *) SDL_calloc(1, sizeof (*handle));
if (!handle) {
return; // oh well.
}