From 20a4e31a12ea2f7f472dcf3d57baff315ae2b81b Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 7 Feb 2023 09:47:17 -0800
Subject: [PATCH] Re-added the internal hint SDL_BORDERLESS_WINDOWED_STYLE
sdl2-compat should set this to "0"
---
src/video/windows/SDL_windowswindow.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c
index 5a8458790631..24230b3bbb20 100644
--- a/src/video/windows/SDL_windowswindow.c
+++ b/src/video/windows/SDL_windowswindow.c
@@ -77,7 +77,15 @@ static DWORD GetWindowStyle(SDL_Window *window)
style |= STYLE_FULLSCREEN;
} else {
if (window->flags & SDL_WINDOW_BORDERLESS) {
- style |= STYLE_BORDERLESS_WINDOWED;
+ /* This behavior more closely matches other platform where the window is borderless
+ but still interacts with the window manager (e.g. task bar shows above it, it can
+ be resized to fit within usable desktop area, etc.)
+ */
+ if (SDL_GetHintBoolean("SDL_BORDERLESS_WINDOWED_STYLE", SDL_TRUE)) {
+ style |= STYLE_BORDERLESS_WINDOWED;
+ } else {
+ style |= STYLE_BORDERLESS;
+ }
} else {
style |= STYLE_NORMAL;
}