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 5323

Summary: SDL_SetWindowMaximumSize fails if Width or Height is equal to minimum Height or Width
Product: SDL Reporter: batyastudios
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: don't know   
Hardware: x86   
OS: Windows 7   

Description batyastudios 2020-10-20 16:38:30 UTC
Basicly there is problem and somewhat a solution: https://discourse.libsdl.org/t/setwindowmaximumsize-bug/28267 

If you SDL_SetWindowMaximumSize() after SDL_SetWindowMinimumSize() with one of axes have the same value, function will have no effect. 

This: (line 2144@SDL_video.c)
if (max_w <= window->min_w || max_h <= window->min_h) {
    SDL_SetError("SDL_SetWindowMaximumSize(): Tried to set maximum size smaller than minimum size");
    return;
}

May be changed to this:
if (max_w < window->min_w || max_h < window->min_h) {
    SDL_SetError("SDL_SetWindowMaximumSize(): Tried to set maximum size smaller than minimum size");
    return;
}

I dont know if solution may cause platform-specific problem.
Cheers
Comment 1 Sam Lantinga 2020-10-20 18:51:58 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/5e54294cae9e