Wait for a display resize event before sending orientation changes

Fixes https://github.com/libsdl-org/SDL/issues/9585
This commit is contained in:
Sam Lantinga 2024-12-30 15:49:10 -08:00
parent 60deaf5f0f
commit 8704ab8422
3 changed files with 27 additions and 4 deletions

View file

@ -1063,10 +1063,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeRotationChanged)(
break;
}
if (Android_Window) {
SDL_VideoDisplay *display = SDL_GetVideoDisplay(SDL_GetPrimaryDisplay());
SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ORIENTATION, displayCurrentOrientation, 0);
}
Android_SetOrientation(displayCurrentOrientation);
SDL_UnlockMutex(Android_ActivityMutex);
}