The existing code would always enter full-screen exclusive mode if SDL_SetWindowDisplayMode() was called before SDL_SetWindowFullscreen(), even if the flag value was SDL_WINDOW_FULLSCREEN_DESKTOP.
Likewise, the code would always enter full-screen desktop mode if SDL_SetWindowDisplayMode() wasn't called, even if the caller passed SDL_WINDOW_FULLSCREEN to ask for full-screen exclusive mode.
Since SDL3 uses the presence of a full-screen mode to tell whether to use full-screen exclusive or full-screen desktop mode, we will stash the provided display mode in a property until we know whether the caller actually wants modesetting or not.
While I was here modifying this code, I also fixed some SDL3_GetPrimaryDisplay() calls that should have been using SDL3_GetDisplayForWindow() instead.
The existing code would always enter full-screen exclusive mode if SDL_SetWindowDisplayMode() was called before SDL_SetWindowFullscreen(), even if the flag value was SDL_WINDOW_FULLSCREEN_DESKTOP.
Likewise, the code would always enter full-screen desktop mode if SDL_SetWindowDisplayMode() wasn't called, even if the caller passed SDL_WINDOW_FULLSCREEN to ask for full-screen exclusive mode.
Since SDL3 uses the presence of a full-screen mode to tell whether to use full-screen exclusive or full-screen desktop mode, we will stash the provided display mode in a property until we know whether the caller actually wants modesetting or not.
While I was here modifying this code, I also fixed some
SDL3_GetPrimaryDisplay()
calls that should have been usingSDL3_GetDisplayForWindow()
instead.