- Sébastien Ramage : End scrollbar tracking if the mouse capture is lost.
- Reduce diff to wine.

svn path=/trunk/; revision=46484
This commit is contained in:
James Tabor 2010-03-27 04:20:07 +00:00
parent c0ce6da513
commit 3ae7b85b5a

View file

@ -1196,64 +1196,44 @@ VOID FASTCALL
ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt) ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt)
{ {
MSG Msg; MSG Msg;
RECT WindowRect; UINT XOffset = 0, YOffset = 0;
UINT XOffset, YOffset;
POINT TopLeft;
if (SB_CTL != SBType) if (SBType != SB_CTL)
{ {
GetWindowRect(Wnd, &WindowRect); PWND pwnd = ValidateHwnd(Wnd);
if (!pwnd) return;
Pt.x -= WindowRect.left; XOffset = pwnd->rcClient.left - pwnd->rcWindow.left;
Pt.y -= WindowRect.top; YOffset = pwnd->rcClient.top - pwnd->rcWindow.top;
ScreenToClient(Wnd, &Pt);
TopLeft.x = WindowRect.left; Pt.x += XOffset;
TopLeft.y = WindowRect.top; Pt.y += YOffset;
ScreenToClient(Wnd, &TopLeft); }
XOffset = - TopLeft.x;
YOffset = - TopLeft.y;
}
else
{
XOffset = 0;
YOffset = 0;
}
IntScrollHandleScrollEvent(Wnd, SBType, WM_LBUTTONDOWN, Pt); IntScrollHandleScrollEvent(Wnd, SBType, WM_LBUTTONDOWN, Pt);
do do
{ {
if (! GetMessageW(&Msg, 0, 0, 0)) if (!GetMessageW(&Msg, 0, 0, 0)) break;
{ if (CallMsgFilterW(&Msg, MSGF_SCROLLBAR)) continue;
break; if ( Msg.message == WM_LBUTTONUP ||
} Msg.message == WM_MOUSEMOVE ||
if (CallMsgFilterW(&Msg, MSGF_SCROLLBAR)) (Msg.message == WM_SYSTIMER && Msg.wParam == SCROLL_TIMER))
{ {
continue; Pt.x = LOWORD(Msg.lParam) + XOffset;
} Pt.y = HIWORD(Msg.lParam) + YOffset;
IntScrollHandleScrollEvent(Wnd, SBType, Msg.message, Pt);
switch(Msg.message) }
{ else
case WM_SYSTIMER: {
case WM_LBUTTONUP: TranslateMessage(&Msg);
case WM_MOUSEMOVE: DispatchMessageW(&Msg);
Pt.x = LOWORD(Msg.lParam) + XOffset; }
Pt.y = HIWORD(Msg.lParam) + YOffset; if (!IsWindow(Wnd))
IntScrollHandleScrollEvent(Wnd, SBType, Msg.message, Pt); {
break;
default:
TranslateMessage(&Msg);
DispatchMessageW(&Msg);
break;
}
if (! IsWindow(Wnd))
{
ReleaseCapture(); ReleaseCapture();
break; break;
} }
} } while (Msg.message != WM_LBUTTONUP && GetCapture() == Wnd);
while (WM_LBUTTONUP != Msg.message);
} }