src/video/windows/SDL_windowsevents.c
changeset 8941 9229a54e4952
parent 8938 c73bac338b90
child 8942 3d84839c97b2
equal deleted inserted replaced
8940:850e149d02d8 8941:9229a54e4952
   868 
   868 
   869     case WM_NCHITTEST:
   869     case WM_NCHITTEST:
   870         {
   870         {
   871             SDL_Window *window = data->window;
   871             SDL_Window *window = data->window;
   872             if (window->hit_test) {
   872             if (window->hit_test) {
   873                 const SDL_Point point = { (int) LOWORD(lParam), (int) HIWORD(lParam) };
   873                 POINT winpoint = { (int) LOWORD(lParam), (int) HIWORD(lParam) };
   874                 const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data);
   874                 if (ScreenToClient(data->hwnd, &winpoint)) {
   875                 if (rc == SDL_HITTEST_DRAGGABLE) {
   875                     const SDL_Point point = { (int) winpoint.x, (int) winpoint.y };
   876                     return HTCAPTION;
   876                     const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data);
       
   877                     if (rc == SDL_HITTEST_DRAGGABLE) {
       
   878                         return HTCAPTION;
       
   879                     }
   877                 }
   880                 }
   878                 // if we didn't return, this will call DefWindowProc below.
   881                 // if we didn't return, this will call DefWindowProc below.
   879             }
   882             }
   880         }
   883         }
   881         break;
   884         break;