Update screen index config variable after moving window

The wrong screen was shown in the settings when moving the window to another screen while in windowed mode.
This commit is contained in:
Robert Müller 2024-04-28 13:36:32 +02:00
parent 86bf5424e3
commit e4dddb95ce
2 changed files with 5 additions and 2 deletions

View file

@ -1539,6 +1539,7 @@ bool CGraphicsBackend_SDL_GL::UpdateDisplayMode(int Index)
return false;
}
g_Config.m_GfxScreen = Index;
g_Config.m_GfxDesktopWidth = DisplayMode.w;
g_Config.m_GfxDesktopHeight = DisplayMode.h;

View file

@ -3929,8 +3929,10 @@ void CClient::SwitchWindowScreen(int Index)
int IsFullscreen = g_Config.m_GfxFullscreen;
int IsBorderless = g_Config.m_GfxBorderless;
if(Graphics()->SetWindowScreen(Index))
g_Config.m_GfxScreen = Index;
if(!Graphics()->SetWindowScreen(Index))
{
return;
}
SetWindowParams(3, false); // prevent DDNet to get stretch on monitors