diff --git a/Platforms/Game/.SDL2/SDLGameWindow.cs b/Platforms/Game/.SDL2/SDLGameWindow.cs index 94ef14aa2..efc7b04ae 100644 --- a/Platforms/Game/.SDL2/SDLGameWindow.cs +++ b/Platforms/Game/.SDL2/SDLGameWindow.cs @@ -537,16 +537,6 @@ internal void EndScreenDeviceChange(int clientWidth, int clientHeight, bool will _height = clientHeight; } - if (!_wasMoved) - { - int posX = prevBounds.X + ((prevBounds.Width - clientWidth) / 2); - int posY = prevBounds.Y + ((prevBounds.Height - clientHeight) / 2); - SDL.WINDOW.GetBorderSize(_handle, out int borderTop, out int borderLeft, out int borderBottom, out int borderRight); - posX = Math.Max(posX, borderLeft); - posY = Math.Max(posY, borderTop); - SDL.WINDOW.SetPosition(Handle, posX, posY); - } - if (!_isFullScreen) OnClientSizeChanged(); @@ -568,19 +558,7 @@ internal void EndScreenDeviceChange(int clientWidth, int clientHeight, bool will if (!_wasMoved) { - if (_isFullScreen) - { - // This centering only occurs when exiting fullscreen - // so it should center the window on the current display. - - // We need to get the display information again in case - // the resolution of it was changed. - SDL.DISPLAY.GetBounds(windowDisplayIndex, out displayBounds); - int posX = displayBounds.X + displayBounds.Width / 2 - clientWidth / 2; - int posY = displayBounds.Y + displayBounds.Height / 2 - clientHeight / 2; - SDL.WINDOW.SetPosition(Handle, posX, posY); - } - else + if (!_isFullScreen) { int posX = prevBounds.X + ((prevBounds.Width - clientWidth) / 2); int posY = prevBounds.Y + ((prevBounds.Height - clientHeight) / 2); @@ -605,8 +583,6 @@ internal void EndScreenDeviceChange(int clientWidth, int clientHeight, bool will internal void EndCreateDevice(int clientWidth, int clientHeight, bool willBeFullScreen, bool willBeExclusiveFullScreen) { - Rectangle prevBounds = ClientBounds; - int windowDisplayIndex = SDL.DISPLAY.GetWindowDisplayIndex(Handle); SDL.DISPLAY.GetBounds(windowDisplayIndex, out Sdl.Rectangle displayBounds); @@ -633,16 +609,6 @@ internal void EndCreateDevice(int clientWidth, int clientHeight, bool willBeFull _height = clientHeight; } - if (!_wasMoved) - { - int posX = prevBounds.X + ((prevBounds.Width - clientWidth) / 2); - int posY = prevBounds.Y + ((prevBounds.Height - clientHeight) / 2); - SDL.WINDOW.GetBorderSize(_handle, out int borderTop, out int borderLeft, out int borderBottom, out int borderRight); - posX = Math.Max(posX, borderLeft); - posY = Math.Max(posY, borderTop); - SDL.WINDOW.SetPosition(Handle, posX, posY); - } - OnClientSizeChanged(); _isFullScreen = true;