mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 08:46:09 +00:00
Win32: Return HTCLIENT when the mouse is above scrollbars but inside the client area
This commit is contained in:
parent
0d2b3d1d68
commit
0f99c78174
@ -325,15 +325,25 @@ static LRESULT CALLBACK wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara
|
|||||||
|
|
||||||
case WM_NCHITTEST: {
|
case WM_NCHITTEST: {
|
||||||
LRESULT result = ::CallWindowProc(base_wndproc, hwnd, msg, wparam, lparam);
|
LRESULT result = ::CallWindowProc(base_wndproc, hwnd, msg, wparam, lparam);
|
||||||
|
gfx::Point pt(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam));
|
||||||
|
|
||||||
|
RECT rc;
|
||||||
|
::GetClientRect(hwnd, &rc);
|
||||||
|
::MapWindowPoints(hwnd, NULL, (POINT*)&rc, 2);
|
||||||
|
gfx::Rect area(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
|
||||||
|
|
||||||
|
//PRINTF("NCHITTEST: %d %d - %d %d %d %d - %s\n", pt.x, pt.y, area.x, area.y, area.w, area.h, area.contains(pt) ? "true": "false");
|
||||||
|
|
||||||
// We ignore scrollbars so if the mouse is above them, we return
|
// We ignore scrollbars so if the mouse is above them, we return
|
||||||
// as it's in the window resize area. (Remember that we have
|
// as it's in the window client or resize area. (Remember that
|
||||||
// scroll bars are enabled and visible to receive trackpad
|
// we have scroll bars are enabled and visible to receive
|
||||||
// messages only.)
|
// trackpad messages only.)
|
||||||
if (result == HTHSCROLL)
|
if (result == HTHSCROLL) {
|
||||||
result = HTBOTTOM;
|
result = (area.contains(pt) ? HTCLIENT: HTBOTTOM);
|
||||||
else if (result == HTVSCROLL)
|
}
|
||||||
result = HTRIGHT;
|
else if (result == HTVSCROLL) {
|
||||||
|
result = (area.contains(pt) ? HTCLIENT: HTRIGHT);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user