diff --git a/src/core/winrt/SDL_winrtapp_direct3d.cpp b/src/core/winrt/SDL_winrtapp_direct3d.cpp index d91451068..009d1a52c 100644 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp @@ -126,6 +126,16 @@ static void WINRT_SetDisplayOrientationsPreference(void *userdata, const char *n { SDL_assert(SDL_strcmp(name, SDL_HINT_ORIENTATIONS) == 0); + /* HACK: prevent SDL from altering an app's .appxmanifest-set orientation + * from being changed on startup, by detecting when SDL_HINT_ORIENTATIONS + * is getting registered. + * + * TODO, WinRT: consider reading in an app's .appxmanifest file, and apply its orientation when 'newValue == NULL'. + */ + if ((oldValue == NULL) && (newValue == NULL)) { + return; + } + // Start with no orientation flags, then add each in as they're parsed // from newValue. unsigned int orientationFlags = 0;