mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Mac: Reset display if going from fullscreen to a fullscreen Space or vice-versa.
Otherwise, bad things happen.
This commit is contained in:
parent
7bc72eaf84
commit
c5e68d68e7
@ -1138,6 +1138,17 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef __MACOSX__
|
#ifdef __MACOSX__
|
||||||
|
/* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */
|
||||||
|
if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) {
|
||||||
|
Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE);
|
||||||
|
} else if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)) {
|
||||||
|
display = SDL_GetDisplayForWindow(window);
|
||||||
|
SDL_SetDisplayModeForDisplay(display, NULL);
|
||||||
|
if (_this->SetWindowFullscreen) {
|
||||||
|
_this->SetWindowFullscreen(_this, window, display, SDL_FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) {
|
if (Cocoa_SetWindowFullscreenSpace(window, fullscreen)) {
|
||||||
window->last_fullscreen_flags = window->flags;
|
window->last_fullscreen_flags = window->flags;
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user