mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 16:15:31 +00:00
Fix
This commit is contained in:
parent
e98ae3262e
commit
8aa57a745a
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue