1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 16:15:31 +00:00
This commit is contained in:
Mads Buvik Sandvei 2020-07-14 13:19:51 +02:00
parent e98ae3262e
commit 8aa57a745a

View file

@ -88,6 +88,14 @@ namespace SDLUtil
{
SDL_SetWindowSize(mWindow, width, height);
SDL_SetWindowBordered(mWindow, windowBorder ? SDL_TRUE : SDL_FALSE);
// Some display managers will automatically maximize windows whose resolution matches its current display.
// This breaks the SDL window if we don't move the window to the corner of that display.
auto index = SDL_GetWindowDisplayIndex(mWindow);
SDL_Rect rect{};
SDL_GetDisplayBounds(index, &rect);
if (width == rect.w && height == rect.h)
SDL_SetWindowPosition(mWindow, rect.x, rect.y);
}
}