Skip to content

Commit d9ac217

Browse files
committed
Move window-size bounding into the texture and GL blocks
1 parent 118bdbb commit d9ac217

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/gui/sdlmain.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,13 @@ Bitu GFX_SetSize(int width,
19551955
retFlags |= GFX_CAN_RANDOM;
19561956
}
19571957

1958+
// Re-apply the minimum bounds prior to clipping the
1959+
// texture-based window because SDL invalidates the prior bounds
1960+
// in the above changes.
1961+
SDL_SetWindowMinimumSize(sdl.window,
1962+
FALLBACK_WINDOW_DIMENSIONS.x,
1963+
FALLBACK_WINDOW_DIMENSIONS.y);
1964+
19581965
// One-time intialize the window size
19591966
if (!sdl.desktop.window.adjusted_initial_size) {
19601967
initialize_sdl_window_size(sdl.window,
@@ -2024,6 +2031,13 @@ Bitu GFX_SetSize(int width,
20242031
SDL_GetError());
20252032
}
20262033

2034+
// Re-apply the minimum bounds prior to clipping the OpenGL
2035+
// window because SDL invalidates the prior bounds in the above
2036+
// window changes.
2037+
SDL_SetWindowMinimumSize(sdl.window,
2038+
FALLBACK_WINDOW_DIMENSIONS.x,
2039+
FALLBACK_WINDOW_DIMENSIONS.y);
2040+
20272041
SetupWindowScaled(SCREEN_OPENGL, sdl.desktop.want_resizable_window);
20282042

20292043
/* We may simply use SDL_BYTESPERPIXEL
@@ -2270,14 +2284,6 @@ Bitu GFX_SetSize(int width,
22702284
}
22712285
#endif // C_OPENGL
22722286
}
2273-
2274-
// Always re-apply the minimum size to the updated window instead of
2275-
// checking GetWindowMinumSize, as SDL invalidates the prior set
2276-
// minimums when switching from fullscreen back to windowed.
2277-
SDL_SetWindowMinimumSize(sdl.window,
2278-
FALLBACK_WINDOW_DIMENSIONS.x,
2279-
FALLBACK_WINDOW_DIMENSIONS.y);
2280-
22812287
// Ensure mouse emulation knows the current parameters
22822288
NewMouseScreenParams();
22832289
update_vsync_state();

0 commit comments

Comments
 (0)