[PATCH v2 0/1] MR9795: comctl32: Set default acceleration values for up-down controls.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57516 -- v2: comctl32: Set default acceleration values for up-down controls. https://gitlab.winehq.org/wine/wine/-/merge_requests/9795
From: Sven Baars <sbaars@codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57516 --- dlls/comctl32/tests/updown.c | 22 ++++++++++++++++++---- dlls/comctl32/updown.c | 14 +++++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index d863e2692e0..dc833df782c 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c @@ -461,7 +461,7 @@ static void test_updown_pos(void) r = SendMessageA(updown, UDM_GETPOS32, 0, 0); if (r) { - UDACCEL accel; + UDACCEL accel[3]; flush_sequences(sequences, NUM_MSG_SEQUENCES); @@ -476,11 +476,25 @@ static void test_updown_pos(void) expect(1, LOWORD(r)); expect(40, HIWORD(r)); - accel.nSec = 0; - accel.nInc = 5; - r = SendMessageA(updown, UDM_SETACCEL, 1, (LPARAM)&accel); + r = SendMessageA(updown, UDM_GETACCEL, 3, (LPARAM)accel); + expect(3, r); + expect(0, accel[0].nSec); + expect(1, accel[0].nInc); + expect(2, accel[1].nSec); + expect(5, accel[1].nInc); + expect(5, accel[2].nSec); + expect(20, accel[2].nInc); + + accel[0].nSec = 0; + accel[0].nInc = 5; + r = SendMessageA(updown, UDM_SETACCEL, 1, (LPARAM)accel); expect(TRUE, r); + r = SendMessageA(updown, UDM_GETACCEL, 3, (LPARAM)accel); + expect(1, r); + expect(0, accel[0].nSec); + expect(5, accel[0].nInc); + r = SendMessageA(updown, UDM_GETPOS, 0, 0); expect(40, LOWORD(r)); expect(1, HIWORD(r)); diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index afa96c87ec4..b136db153a0 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -999,9 +999,6 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L infoPtr->Self = hwnd; infoPtr->Notify = pcs->hwndParent; infoPtr->dwStyle = pcs->style; - infoPtr->AccelCount = 0; - infoPtr->AccelVect = 0; - infoPtr->AccelIndex = -1; infoPtr->CurVal = 0; infoPtr->MinVal = 100; infoPtr->MaxVal = 0; @@ -1009,6 +1006,17 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L infoPtr->Buddy = 0; /* No buddy window yet */ infoPtr->Flags = (infoPtr->dwStyle & UDS_SETBUDDYINT) ? FLAG_BUDDYINT : 0; + infoPtr->AccelCount = 3; + infoPtr->AccelIndex = -1; + infoPtr->AccelVect = Alloc(infoPtr->AccelCount * sizeof(UDACCEL)); + + infoPtr->AccelVect[0].nSec = 0; + infoPtr->AccelVect[0].nInc = 1; + infoPtr->AccelVect[1].nSec = 2; + infoPtr->AccelVect[1].nInc = 5; + infoPtr->AccelVect[2].nSec = 5; + infoPtr->AccelVect[2].nInc = 20; + SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle & ~WS_BORDER); if (!(infoPtr->dwStyle & UDS_HORZ)) SetWindowPos (hwnd, NULL, 0, 0, DEFAULT_WIDTH, pcs->cy, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9795
On Thu Dec 18 16:50:18 2025 +0000, Sven Baars wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/9795/diffs?diff_id=233361&start_sha=a07aedf1117502bdaf574afe322ddc0668ba4df7#21af8a13e9d76709c5965c4bda30160affc12006_479_479) Ah, yeah, that line can be removed now. Thanks!
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9795#note_125822
Nikolay Sivov (@nsivov) commented about dlls/comctl32/tests/updown.c:
expect(1, LOWORD(r)); expect(40, HIWORD(r));
- accel.nSec = 0; - accel.nInc = 5; - r = SendMessageA(updown, UDM_SETACCEL, 1, (LPARAM)&accel); + r = SendMessageA(updown, UDM_GETACCEL, 3, (LPARAM)accel); + expect(3, r); + expect(0, accel[0].nSec); + expect(1, accel[0].nInc); + expect(2, accel[1].nSec); + expect(5, accel[1].nInc); + expect(5, accel[2].nSec); + expect(20, accel[2].nInc); +
Will we be able to tell if 3 is in fact an initial number of those parameters, by using wParam = 4? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9795#note_125839
Could you please also enable comctl32 v6 tests for the Updown? It's enough to test only new changes, if some of existing tests do not pass. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9795#note_125840
participants (3)
-
Nikolay Sivov (@nsivov) -
Sven Baars -
Sven Baars (@sbaars)