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: Gabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9cd29b325f
commit
d2cf3e9763
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue