src/video/windows/SDL_windowsevents.c
changeset 11874 b0e4f5085af4
parent 11872 e917e911dab6
child 11938 fbfacc66c65c
equal deleted inserted replaced
11873:96157e099383 11874:b0e4f5085af4
   965         }
   965         }
   966         break;
   966         break;
   967 
   967 
   968     case WM_NCCALCSIZE:
   968     case WM_NCCALCSIZE:
   969         {
   969         {
   970             if (wParam == TRUE && SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) {
   970             Uint32 window_flags = SDL_GetWindowFlags(data->window);
       
   971             if (wParam == TRUE && (window_flags & SDL_WINDOW_BORDERLESS) && !(window_flags & SDL_WINDOW_FULLSCREEN)) {
   971                 /* When borderless, need to tell windows that the size of the non-client area is 0 */
   972                 /* When borderless, need to tell windows that the size of the non-client area is 0 */
   972                 if (!(SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE)) {
   973                 if (!(window_flags & SDL_WINDOW_RESIZABLE)) {
   973                     int w, h;
   974                     int w, h;
   974                     NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam;
   975                     NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam;
   975                     SDL_GetWindowSize(data->window, &w, &h);
   976                     w = data->window->windowed.w;
       
   977                     h = data->window->windowed.h;
   976                     params->rgrc[0].right = params->rgrc[0].left + w;
   978                     params->rgrc[0].right = params->rgrc[0].left + w;
   977                     params->rgrc[0].bottom = params->rgrc[0].top + h;
   979                     params->rgrc[0].bottom = params->rgrc[0].top + h;
   978                 }
   980                 }
   979                 return 0;
   981                 return 0;
   980             }
   982             }