From 25df5a5ac9662582dbe3c74115fb169cc8217720 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 28 Nov 2017 18:31:18 -0800 Subject: [PATCH] Non-resizable windows need to have their window rect set to the client rect --- src/video/windows/SDL_windowsevents.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index b73e9df8b..b12c0ce31 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -951,9 +951,17 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_NCCALCSIZE: { - // When borderless, need to tell windows that the size of the non-client area is 0 - if ( wParam == TRUE && SDL_GetWindowFlags( data->window ) & SDL_WINDOW_BORDERLESS ) + if (wParam == TRUE && SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) { + /* When borderless, need to tell windows that the size of the non-client area is 0 */ + if (!(SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE)) { + int w, h; + NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam; + SDL_GetWindowSize(data->window, &w, &h); + params->rgrc[0].right = params->rgrc[0].left + w; + params->rgrc[0].bottom = params->rgrc[0].top + h; + } return 0; + } } break;