Commit d2cf3e97 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

user32: Fix tracking position for non-client scrollbars.

Non-client scrollbars (SB_HORZ and SB_VERT) don't have their client origin at (0,0) because they can have non-client borders. It is necessary to offset by this origin just as it is done for LBUTTONDOWN. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9cd29b32
......@@ -1095,15 +1095,17 @@ static void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt )
{
MSG msg;
RECT rect;
if (scrollbar != SB_CTL)
{
RECT rect;
WIN_GetRectangles( hwnd, COORDS_CLIENT, &rect, NULL );
ScreenToClient( hwnd, &pt );
pt.x -= rect.left;
pt.y -= rect.top;
}
else
rect.left = rect.top = 0;
SCROLL_HandleScrollEvent( hwnd, scrollbar, WM_LBUTTONDOWN, pt );
......@@ -1115,8 +1117,8 @@ void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt )
msg.message == WM_MOUSEMOVE ||
(msg.message == WM_SYSTIMER && msg.wParam == SCROLL_TIMER))
{
pt.x = (short)LOWORD(msg.lParam);
pt.y = (short)HIWORD(msg.lParam);
pt.x = (short)LOWORD(msg.lParam) - rect.left;
pt.y = (short)HIWORD(msg.lParam) - rect.top;
SCROLL_HandleScrollEvent( hwnd, scrollbar, msg.message, pt );
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment