mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-17 15:21:43 +00:00
Send display mode change events when the orientation changes
This commit is contained in:
@@ -501,9 +501,15 @@ void SDL_OnApplicationDidChangeStatusBarOrientation(void)
|
|||||||
* fullscreen desktop keeps the window dimensions in the
|
* fullscreen desktop keeps the window dimensions in the
|
||||||
* correct orientation. */
|
* correct orientation. */
|
||||||
if (isLandscape != (mode->w > mode->h)) {
|
if (isLandscape != (mode->w > mode->h)) {
|
||||||
int height = mode->w;
|
SDL_DisplayMode new_mode;
|
||||||
mode->w = mode->h;
|
SDL_copyp(&new_mode, mode);
|
||||||
mode->h = height;
|
new_mode.w = mode->h;
|
||||||
|
new_mode.h = mode->w;
|
||||||
|
|
||||||
|
// Make sure we don't free the current display mode data
|
||||||
|
mode->internal = NULL;
|
||||||
|
|
||||||
|
SDL_SetDesktopDisplayMode(display, &new_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Same deal with the fullscreen modes
|
// Same deal with the fullscreen modes
|
||||||
|
Reference in New Issue
Block a user