From 3905f9f9a71aac746af4e9244007d476ed018370 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sat, 15 Nov 2008 21:50:54 -0600 Subject: [PATCH] comctl32: do not repaint on TBM_SETPOS if position is unchanged --- dlls/comctl32/tests/trackbar.c | 4 ++++ dlls/comctl32/trackbar.c | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/tests/trackbar.c b/dlls/comctl32/tests/trackbar.c index f69e286..f54e32e 100644 --- a/dlls/comctl32/tests/trackbar.c +++ b/dlls/comctl32/tests/trackbar.c @@ -141,11 +141,13 @@ static const struct message position_test_seq[] = { { TBM_SETPOS, sent|wparam|lparam, TRUE, 5}, { WM_PAINT, sent|defwinproc}, { TBM_GETPOS, sent}, + { TBM_SETPOS, sent|wparam|lparam, TRUE, 5}, { TBM_SETPOS, sent|wparam|lparam, TRUE, 1000}, { WM_PAINT, sent|defwinproc}, { TBM_GETPOS, sent}, { TBM_SETPOS, sent|wparam|lparam, FALSE, 20}, { TBM_GETPOS, sent}, + { TBM_SETPOS, sent|wparam|lparam, TRUE, 20}, { TBM_GETPOS, sent}, {0} }; @@ -605,12 +607,14 @@ static void test_position(HWND hWndTrackbar){ SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); expect(5, r); + SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5); SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 1000); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); expect(100, r); SendMessage(hWndTrackbar, TBM_SETPOS, FALSE, 20); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); expect(20, r); + SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 20); /* test TBM_GETPOS */ r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index a9959e2..c72f29b 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1148,7 +1148,7 @@ TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition) infoPtr->lPos = infoPtr->lRangeMax; infoPtr->flags |= TB_THUMBPOSCHANGED; - if (fPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); + if (fPosition && oldPos != lPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); return 0; } -- 1.6.0.4