Fix crash in UIKit indirect pointer handling

(cherry picked from commit 5cacdf2513)
This commit is contained in:
kiddkaffeine
2025-04-13 06:49:01 -04:00
committed by Sam Lantinga
parent 0237997e4d
commit 5a05ef01ad

View File

@@ -240,7 +240,7 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
int i; int i;
SDL_MouseButtonFlags buttons = SDL_GetMouseState(NULL, NULL); SDL_MouseButtonFlags buttons = SDL_GetMouseState(NULL, NULL);
for (i = 0; i < MAX_MOUSE_BUTTONS; ++i) { for (i = 1; i <= MAX_MOUSE_BUTTONS; ++i) {
if (buttons & SDL_BUTTON_MASK(i)) { if (buttons & SDL_BUTTON_MASK(i)) {
SDL_SendMouseButton(UIKit_GetEventTimestamp([touch timestamp]), sdlwindow, SDL_GLOBAL_MOUSE_ID, (Uint8)i, false); SDL_SendMouseButton(UIKit_GetEventTimestamp([touch timestamp]), sdlwindow, SDL_GLOBAL_MOUSE_ID, (Uint8)i, false);
} }