From 5abd7d16d7482049a51ad94f7d4f500834bd2970 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Feb 2018 22:58:20 -0800 Subject: [PATCH] Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window transition --- src/video/windows/SDL_windowsevents.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 7bcfd6be6..a5fd00689 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -967,12 +967,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_NCCALCSIZE: { - if (wParam == TRUE && SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) { + Uint32 window_flags = SDL_GetWindowFlags(data->window); + if (wParam == TRUE && (window_flags & SDL_WINDOW_BORDERLESS) && !(window_flags & SDL_WINDOW_FULLSCREEN)) { /* When borderless, need to tell windows that the size of the non-client area is 0 */ - if (!(SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE)) { + if (!(window_flags & SDL_WINDOW_RESIZABLE)) { int w, h; NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam; - SDL_GetWindowSize(data->window, &w, &h); + w = data->window->windowed.w; + h = data->window->windowed.h; params->rgrc[0].right = params->rgrc[0].left + w; params->rgrc[0].bottom = params->rgrc[0].top + h; }