mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 08:39:05 +00:00
[User32]
- 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:
parent
c0ce6da513
commit
3ae7b85b5a
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue