Skip to content

Commit 90a0230

Browse files
committed
win32: Use STYLE_BORDERLESS when showing a pending fullscreen window
In addition to hiding the border on bordered windows that will immediately become fullscreen, The combination of flags used in STYLE_BORDERLESS_WINDOWED will still show the borders on borderless windows if the initial window size exactly matches the desktop, so STYLE_BORDERLESS must be used instead.
1 parent aae7736 commit 90a0230

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/video/windows/SDL_windowswindow.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,16 +1071,16 @@ void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
10711071
WIN_SetWindowPosition(_this, window);
10721072
}
10731073

1074-
// If the window isn't borderless and will be fullscreen, use the borderless style to hide the initial borders.
1074+
/* If the window will immediately become fullscreen, use the borderless style to hide the initial borders.
1075+
*
1076+
* Note: The combination of flags used in STYLE_BORDERLESS_WINDOWED will still briefly show the borders if
1077+
* the initial window size exactly matches the desktop, so STYLE_BORDERLESS must be used instead.
1078+
*/
10751079
if (window->pending_flags & SDL_WINDOW_FULLSCREEN) {
1076-
if (!(window->flags & SDL_WINDOW_BORDERLESS)) {
1077-
window->flags |= SDL_WINDOW_BORDERLESS;
1078-
style = GetWindowLong(hwnd, GWL_STYLE);
1079-
style &= ~STYLE_MASK;
1080-
style |= GetWindowStyle(window);
1081-
SetWindowLong(hwnd, GWL_STYLE, style);
1082-
window->flags &= ~SDL_WINDOW_BORDERLESS;
1083-
}
1080+
style = GetWindowLong(hwnd, GWL_STYLE);
1081+
style &= ~STYLE_MASK;
1082+
style |= STYLE_BORDERLESS;
1083+
SetWindowLong(hwnd, GWL_STYLE, style);
10841084
}
10851085
style = GetWindowLong(hwnd, GWL_EXSTYLE);
10861086
if (style & WS_EX_NOACTIVATE) {

0 commit comments

Comments
 (0)