From: Fabian Maurer dark.shadow4@web.de
This fixes a regression from bb496ea8 where we got a WM_MOUSEMOVE and this leads to skipping the initial scroll delay. Also closer mimics windows behavior, moving the mouse should not reset the scrolling timer.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56582 --- dlls/win32u/scroll.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/scroll.c b/dlls/win32u/scroll.c index 5ea35f1d908..26cc502aa31 100644 --- a/dlls/win32u/scroll.c +++ b/dlls/win32u/scroll.c @@ -62,6 +62,9 @@ static struct SCROLL_TRACKING_INFO g_tracking_info; /* Is the moving thumb being displayed? */ static BOOL scroll_moving_thumb = FALSE;
+/* is there currently a running timer for scrolling delay ?*/ +static BOOL scroll_timer_running = FALSE; + /* data for window that has (one or two) scroll bars */ struct win_scroll_bar_info { @@ -519,12 +522,21 @@ void update_scroll_timer(HWND hwnd, HWND owner_hwnd, HWND ctl_hwnd, enum SCROLL_ if (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER) { send_message( owner_hwnd, vertical ? WM_VSCROLL : WM_HSCROLL, msg_send, (LPARAM)ctl_hwnd ); + scroll_timer_running = FALSE; }
- NtUserSetSystemTimer( hwnd, SCROLL_TIMER, - msg == WM_LBUTTONDOWN ? SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY ); + if (!scroll_timer_running) + { + scroll_timer_running = TRUE; + NtUserSetSystemTimer( hwnd, SCROLL_TIMER, + msg == WM_LBUTTONDOWN ? SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY ); + } + } + else + { + scroll_timer_running = FALSE; + NtUserKillSystemTimer( hwnd, SCROLL_TIMER ); } - else NtUserKillSystemTimer( hwnd, SCROLL_TIMER ); }
/*********************************************************************** @@ -789,6 +801,7 @@ void handle_scroll_event( HWND hwnd, int bar, UINT msg, POINT pt ) /* Terminate tracking */ g_tracking_info.win = 0; scroll_moving_thumb = FALSE; + scroll_timer_running = FALSE; hittest = SCROLL_NOWHERE; draw_scroll_bar( hwnd, hdc, bar, hittest, &g_tracking_info, TRUE, TRUE ); }