Signed-off-by: Waritnan Sookbuntherng lion328@hotmail.co.th --- v2: Add this commit for checking bounds inclusively. v3: Determine bounds using x-axis only. --- dlls/comctl32/status.c | 5 +---- dlls/comctl32/tests/status.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 3bf72fa577..6ea7d9e997 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -1009,10 +1009,7 @@ STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y) pt.y = y; ScreenToClient (infoPtr->Self, &pt);
- rect.left = rect.right - 13; - rect.top += 2; - - if (PtInRect (&rect, pt)) + if (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL)) { if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT; else return HTBOTTOMRIGHT; diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c index 2841a502ae..f37f5ce431 100644 --- a/dlls/comctl32/tests/status.c +++ b/dlls/comctl32/tests/status.c @@ -625,12 +625,12 @@ static void test_sizegrip(void)
/* check bounds when not maximized */ SETWNDLONG(FALSE, FALSE); - todo_wine TEST_NCHITTEST(rcGripper.left, rcGripper.top, HTBOTTOMRIGHT); + TEST_NCHITTEST(rcGripper.left, rcGripper.top, HTBOTTOMRIGHT); TEST_NCHITTEST(rcGripper.left - 1, rcGripper.top, HTCLIENT); - todo_wine TEST_NCHITTEST(rcGripper.left, rcGripper.top - 1, HTBOTTOMRIGHT); - todo_wine TEST_NCHITTEST(rcGripper.right, rcGripper.bottom, HTBOTTOMRIGHT); - todo_wine TEST_NCHITTEST(rcGripper.right + 1, rcGripper.bottom, HTBOTTOMRIGHT); - todo_wine TEST_NCHITTEST(rcGripper.right, rcGripper.bottom + 1, HTBOTTOMRIGHT); + TEST_NCHITTEST(rcGripper.left, rcGripper.top - 1, HTBOTTOMRIGHT); + TEST_NCHITTEST(rcGripper.right, rcGripper.bottom, HTBOTTOMRIGHT); + TEST_NCHITTEST(rcGripper.right + 1, rcGripper.bottom, HTBOTTOMRIGHT); + TEST_NCHITTEST(rcGripper.right, rcGripper.bottom + 1, HTBOTTOMRIGHT); TEST_NCHITTEST(rcGripper.right - 1, rcGripper.bottom - 1, HTBOTTOMRIGHT);
/* maximized */ @@ -645,12 +645,12 @@ static void test_sizegrip(void)
/* not maximized and right-to-left */ SETWNDLONG(FALSE, TRUE); - todo_wine TEST_NCHITTEST(rcGripper.left, rcGripper.top, HTBOTTOMLEFT); + TEST_NCHITTEST(rcGripper.left, rcGripper.top, HTBOTTOMLEFT); TEST_NCHITTEST(rcGripper.left - 1, rcGripper.top, HTCLIENT); - todo_wine TEST_NCHITTEST(rcGripper.left, rcGripper.top - 1, HTBOTTOMLEFT); - todo_wine TEST_NCHITTEST(rcGripper.right, rcGripper.bottom, HTBOTTOMLEFT); - todo_wine TEST_NCHITTEST(rcGripper.right + 1, rcGripper.bottom, HTBOTTOMLEFT); - todo_wine TEST_NCHITTEST(rcGripper.right, rcGripper.bottom + 1, HTBOTTOMLEFT); + TEST_NCHITTEST(rcGripper.left, rcGripper.top - 1, HTBOTTOMLEFT); + TEST_NCHITTEST(rcGripper.right, rcGripper.bottom, HTBOTTOMLEFT); + TEST_NCHITTEST(rcGripper.right + 1, rcGripper.bottom, HTBOTTOMLEFT); + TEST_NCHITTEST(rcGripper.right, rcGripper.bottom + 1, HTBOTTOMLEFT); TEST_NCHITTEST(rcGripper.right - 1, rcGripper.bottom - 1, HTBOTTOMLEFT);
/* maximized with right-to-left */