|
@@ -51,9 +51,14 @@ static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
|
|
|
static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
|
|
|
static ATOM SDL_HelperWindowClass = 0;
|
|
|
|
|
|
+// for borderless Windows, still want the following flags:
|
|
|
+// - WS_CAPTION: this seems to enable the Windows minimize animation
|
|
|
+// - WS_SYSMENU: enables system context menu on task bar
|
|
|
+// - WS_MINIMIZEBOX: window will respond to Windows minimize commands sent to all windows, such as windows key + m, shaking title bar, etc.
|
|
|
+
|
|
|
#define STYLE_BASIC (WS_CLIPSIBLINGS | WS_CLIPCHILDREN)
|
|
|
#define STYLE_FULLSCREEN (WS_POPUP)
|
|
|
-#define STYLE_BORDERLESS (WS_POPUP)
|
|
|
+#define STYLE_BORDERLESS (WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
|
|
|
#define STYLE_NORMAL (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
|
|
|
#define STYLE_RESIZABLE (WS_THICKFRAME | WS_MAXIMIZEBOX)
|
|
|
#define STYLE_MASK (STYLE_FULLSCREEN | STYLE_BORDERLESS | STYLE_NORMAL | STYLE_RESIZABLE)
|
|
@@ -216,10 +221,10 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool cre
|
|
|
} else {
|
|
|
window->flags &= ~SDL_WINDOW_SHOWN;
|
|
|
}
|
|
|
- if (style & (WS_BORDER | WS_THICKFRAME)) {
|
|
|
- window->flags &= ~SDL_WINDOW_BORDERLESS;
|
|
|
- } else {
|
|
|
+ if (style & WS_POPUP) {
|
|
|
window->flags |= SDL_WINDOW_BORDERLESS;
|
|
|
+ } else {
|
|
|
+ window->flags &= ~SDL_WINDOW_BORDERLESS;
|
|
|
}
|
|
|
if (style & WS_THICKFRAME) {
|
|
|
window->flags |= SDL_WINDOW_RESIZABLE;
|
|
@@ -306,6 +311,9 @@ WIN_CreateWindow(_THIS, SDL_Window * window)
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
+ // Inform Windows of the frame change so we can respond to WM_NCCALCSIZE
|
|
|
+ SetWindowPos( hwnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE );
|
|
|
+
|
|
|
if (!(window->flags & SDL_WINDOW_OPENGL)) {
|
|
|
return 0;
|
|
|
}
|