Skip to content

Commit

Permalink
Don't add a frame to borderless windows.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Feb 11, 2020
1 parent f867ceb commit 668276f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/video/windows/SDL_windowswindow.c
Expand Up @@ -93,9 +93,14 @@ GetWindowStyle(SDL_Window * window)
style |= STYLE_NORMAL;
}

/* You can have a borderless resizable window */
if (window->flags & SDL_WINDOW_RESIZABLE) {
style |= STYLE_RESIZABLE;
/* You can have a borderless resizable window, but Windows doesn't always draw it correctly,
see https://bugzilla.libsdl.org/show_bug.cgi?id=4466
*/
if (!(window->flags & SDL_WINDOW_BORDERLESS) ||
SDL_GetHintBoolean("SDL_BORDERLESS_RESIZABLE_STYLE", SDL_FALSE)) {
style |= STYLE_RESIZABLE;
}
}

/* Need to set initialize minimize style, or when we call ShowWindow with WS_MINIMIZE it will activate a random window */
Expand Down

0 comments on commit 668276f

Please sign in to comment.