Don't add a frame to borderless windows.
authorSam Lantinga <slouken@libsdl.org>
Tue, 11 Feb 2020 09:41:55 -0800
changeset 135050c62973859eb
parent 13504 3d991f099f58
child 13506 d5109d6a9b98
Don't add a frame to borderless windows.
It was done to allow hotkey resizing of borderless windows, but Windows will sometimes draw it, regardless of our WM_* message handling. See bug 4466 for more details.
src/video/windows/SDL_windowswindow.c
     1.1 --- a/src/video/windows/SDL_windowswindow.c	Tue Feb 11 08:36:13 2020 -0800
     1.2 +++ b/src/video/windows/SDL_windowswindow.c	Tue Feb 11 09:41:55 2020 -0800
     1.3 @@ -93,9 +93,14 @@
     1.4              style |= STYLE_NORMAL;
     1.5          }
     1.6  
     1.7 -        /* You can have a borderless resizable window */
     1.8          if (window->flags & SDL_WINDOW_RESIZABLE) {
     1.9 -            style |= STYLE_RESIZABLE;
    1.10 +            /* You can have a borderless resizable window, but Windows doesn't always draw it correctly,
    1.11 +               see https://bugzilla.libsdl.org/show_bug.cgi?id=4466
    1.12 +             */
    1.13 +            if (!(window->flags & SDL_WINDOW_BORDERLESS) ||
    1.14 +                SDL_GetHintBoolean("SDL_BORDERLESS_RESIZABLE_STYLE", SDL_FALSE)) {
    1.15 +                style |= STYLE_RESIZABLE;
    1.16 +            }
    1.17          }
    1.18  
    1.19          /* Need to set initialize minimize style, or when we call ShowWindow with WS_MINIMIZE it will activate a random window */