From c8cf407ea39d70941ba1a5ee4f7d589291acd537 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 5 Jun 2014 00:54:43 -0400 Subject: [PATCH] Wired up Windows resize hit testing. --- src/video/windows/SDL_windowsevents.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 6b76215056f25..29be44befdacb 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -897,11 +897,19 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (ScreenToClient(data->hwnd, &winpoint)) { const SDL_Point point = { (int) winpoint.x, (int) winpoint.y }; const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data); - if (rc == SDL_HITTEST_DRAGGABLE) { - return HTCAPTION; + switch (rc) { + case SDL_HITTEST_DRAGGABLE: return HTCAPTION; + case SDL_HITTEST_RESIZE_TOPLEFT: return HTTOPLEFT; + case SDL_HITTEST_RESIZE_TOP: return HTTOP; + case SDL_HITTEST_RESIZE_TOPRIGHT: return HTTOPRIGHT; + case SDL_HITTEST_RESIZE_RIGHT: return HTRIGHT; + case SDL_HITTEST_RESIZE_BOTTOMRIGHT: return HTBOTTOMRIGHT; + case SDL_HITTEST_RESIZE_BOTTOM: return HTBOTTOM; + case SDL_HITTEST_RESIZE_BOTTOMLEFT: return HTBOTTOMLEFT; + case SDL_HITTEST_RESIZE_LEFT: return HTLEFT; } } - // if we didn't return, this will call DefWindowProc below. + /* If we didn't return, this will call DefWindowProc below. */ } } break;