We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3566

Summary: Window Size changes suddenly if SetWindowMaximumSize is lower than SetWindowMinimumSize
Product: SDL Reporter: Rene <king-sora>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.5   
Hardware: x86_64   
OS: Windows 7   

Description Rene 2017-01-24 12:03:54 UTC
I've a SDL window, created with following flags:

SDL_CreateWindow(title, x, y, width, height,
SDL.SDL_WindowFlags.SDL_WINDOW_ALLOW_HIGHDPI | 
SDL.SDL_WindowFlags.SDL_WINDOW_OPENGL | 
SDL.SDL_WindowFlags.SDL_WINDOW_HIDDEN | 
SDL.SDL_WindowFlags.SDL_WINDOW_RESIZABLE);

After that I've the following lines:
SDL_SetWindowMinimumSize(handle, 500, 500);
SDL_SetWindowMaximumSize(handle, 400, 400);

Then I show the window.

The window appears at the Size of 400x400, but after the first user-action (e.g. dragging the window around or trying to resize it) the window turns to the size 500x500.

This does not happen if the SDL.SDL_WindowFlags.SDL_WINDOW_RESIZABLE flag is not set.
Comment 1 Sam Lantinga 2017-01-28 05:17:27 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/7f08396c7581

In this case setting the maximum size will fail, because it's smaller than the minimum size.