Non-resizable windows need to have their window rect set to the client rect
authorSam Lantinga <slouken@libsdl.org>
Tue, 28 Nov 2017 18:31:18 -0800
changeset 1171693edd752e966
parent 11715 35da714ed287
child 11718 3006dd42e4db
Non-resizable windows need to have their window rect set to the client rect
src/video/windows/SDL_windowsevents.c
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Nov 27 15:07:07 2017 -0800
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Tue Nov 28 18:31:18 2017 -0800
     1.3 @@ -951,9 +951,17 @@
     1.4  
     1.5      case WM_NCCALCSIZE:
     1.6          {
     1.7 -            // When borderless, need to tell windows that the size of the non-client area is 0
     1.8 -            if ( wParam == TRUE && SDL_GetWindowFlags( data->window ) & SDL_WINDOW_BORDERLESS )
     1.9 +            if (wParam == TRUE && SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) {
    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 +                    int w, h;
    1.13 +                    NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam;
    1.14 +                    SDL_GetWindowSize(data->window, &w, &h);
    1.15 +                    params->rgrc[0].right = params->rgrc[0].left + w;
    1.16 +                    params->rgrc[0].bottom = params->rgrc[0].top + h;
    1.17 +                }
    1.18                  return 0;
    1.19 +            }
    1.20          }
    1.21          break;
    1.22