Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window transition
authorSam Lantinga <slouken@libsdl.org>
Tue, 13 Feb 2018 22:58:20 -0800
changeset 11874b0e4f5085af4
parent 11873 96157e099383
child 11875 91138f56d762
Don't attempt WM_NCCALCSIZE adjustment when in fullscreen window transition
src/video/windows/SDL_windowsevents.c
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Feb 12 10:47:00 2018 +0300
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Tue Feb 13 22:58:20 2018 -0800
     1.3 @@ -967,12 +967,14 @@
     1.4  
     1.5      case WM_NCCALCSIZE:
     1.6          {
     1.7 -            if (wParam == TRUE && SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) {
     1.8 +            Uint32 window_flags = SDL_GetWindowFlags(data->window);
     1.9 +            if (wParam == TRUE && (window_flags & SDL_WINDOW_BORDERLESS) && !(window_flags & SDL_WINDOW_FULLSCREEN)) {
    1.10                  /* When borderless, need to tell windows that the size of the non-client area is 0 */
    1.11 -                if (!(SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE)) {
    1.12 +                if (!(window_flags & SDL_WINDOW_RESIZABLE)) {
    1.13                      int w, h;
    1.14                      NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam;
    1.15 -                    SDL_GetWindowSize(data->window, &w, &h);
    1.16 +                    w = data->window->windowed.w;
    1.17 +                    h = data->window->windowed.h;
    1.18                      params->rgrc[0].right = params->rgrc[0].left + w;
    1.19                      params->rgrc[0].bottom = params->rgrc[0].top + h;
    1.20                  }