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 3058

Summary: Slight mistake in GetWindowStyle in SDL_windowswindow.c
Product: SDL Reporter: Coriiander <coriiander>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: Windows (All)   

Description Coriiander 2015-07-11 13:36:21 UTC
There's a slight mistake in the function "GetWindowStyle" found in file "SDL_windowswindow.c".

When a window is marked to be resizable, the resizable style is being added regardless of whether the window has a border or not. While for some arcane, hidden semantics this can be ok, it's still inconsistent in this case.

CURRENT:

    if (window->flags & SDL_WINDOW_FULLSCREEN) {
        style |= STYLE_FULLSCREEN;
    } else {
        if (window->flags & SDL_WINDOW_BORDERLESS) {
            style |= STYLE_BORDERLESS;
        } else {
            style |= STYLE_NORMAL;
        }
        if (window->flags & SDL_WINDOW_RESIZABLE) {
            style |= STYLE_RESIZABLE;
        }
    }


CHANGE: (move resizable check into other scope)

    if (window->flags & SDL_WINDOW_FULLSCREEN) {
        style |= STYLE_FULLSCREEN;
    } else {
        if (window->flags & SDL_WINDOW_BORDERLESS) {
            style |= STYLE_BORDERLESS;
        } else {
            style |= STYLE_NORMAL;
            if (window->flags & SDL_WINDOW_RESIZABLE) {
                style |= STYLE_RESIZABLE;
            }
        }
    }
Comment 1 Sam Lantinga 2017-08-12 23:44:14 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/4de70b7f43af