Commit bb844c12 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: invalidate stored window position when changing video mode if the...

engine: invalidate stored window position when changing video mode if the combination of origin position and new window size would place the window outside the bounds of the display
parent f7e65ee3
......@@ -1681,9 +1681,6 @@ int setvideomode_sdlcommonpost(int32_t x, int32_t y, int32_t c, int32_t fs, int3
int const displayindex = SDL_GetWindowDisplayIndex(sdl_window);
int const newdisplayindex = r_displayindex < SDL_GetNumVideoDisplays() ? r_displayindex : displayindex;
if (displayindex != newdisplayindex)
g_windowPosValid = false;
SDL_DisplayMode desktopmode;
if (SDL_GetDesktopDisplayMode(newdisplayindex, &desktopmode))
{
......@@ -1691,6 +1688,9 @@ int setvideomode_sdlcommonpost(int32_t x, int32_t y, int32_t c, int32_t fs, int3
return -1;
}
if (displayindex != newdisplayindex || g_windowPos.x + x < 0 || g_windowPos.y + y < 0 || g_windowPos.x > desktopmode.w || g_windowPos.y > desktopmode.h)
g_windowPosValid = false;
#ifdef _WIN32
if (timingInfo.rateRefresh.uiNumerator && timingInfo.rateRefresh.uiDenominator)
refreshfreq = (double)timingInfo.rateRefresh.uiNumerator / timingInfo.rateRefresh.uiDenominator;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment