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 ---
This fixes, for example, SB_VERT scrollbars that have a non-client area above them (like a title bar) so that when moving the mouse after clicking (hot-tracking), they won't jump by the size of the title bar (which is annoying).
dlls/user32/scroll.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/scroll.c b/dlls/user32/scroll.c index 95d9761..d611cf0 100644 --- a/dlls/user32/scroll.c +++ b/dlls/user32/scroll.c @@ -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
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=45623
Your paranoid android.
=== debian9 (32 bit Chinese:China report) ===
user32: menu.c:2354: Test failed: test 27 menu: Timeout
On 12/11/18 14:16, Marvin wrote:
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=45623
Your paranoid android.
=== debian9 (32 bit Chinese:China report) ===
user32: menu.c:2354: Test failed: test 27 menu: Timeout
user32 tests have too many false positives. Needless to say these are unrelated...