Commit 00e2d897 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

comctl32: Do not repaint on TBM_SETPOS if position is unchanged.

parent 305e732e
...@@ -141,11 +141,13 @@ static const struct message position_test_seq[] = { ...@@ -141,11 +141,13 @@ static const struct message position_test_seq[] = {
{ TBM_SETPOS, sent|wparam|lparam, TRUE, 5}, { TBM_SETPOS, sent|wparam|lparam, TRUE, 5},
{ WM_PAINT, sent|defwinproc}, { WM_PAINT, sent|defwinproc},
{ TBM_GETPOS, sent}, { TBM_GETPOS, sent},
{ TBM_SETPOS, sent|wparam|lparam, TRUE, 5},
{ TBM_SETPOS, sent|wparam|lparam, TRUE, 1000}, { TBM_SETPOS, sent|wparam|lparam, TRUE, 1000},
{ WM_PAINT, sent|defwinproc}, { WM_PAINT, sent|defwinproc},
{ TBM_GETPOS, sent}, { TBM_GETPOS, sent},
{ TBM_SETPOS, sent|wparam|lparam, FALSE, 20}, { TBM_SETPOS, sent|wparam|lparam, FALSE, 20},
{ TBM_GETPOS, sent}, { TBM_GETPOS, sent},
{ TBM_SETPOS, sent|wparam|lparam, TRUE, 20},
{ TBM_GETPOS, sent}, { TBM_GETPOS, sent},
{0} {0}
}; };
...@@ -605,12 +607,14 @@ static void test_position(HWND hWndTrackbar){ ...@@ -605,12 +607,14 @@ static void test_position(HWND hWndTrackbar){
SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5); SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5);
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
expect(5, r); expect(5, r);
SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5);
SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 1000); SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 1000);
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
expect(100, r); expect(100, r);
SendMessage(hWndTrackbar, TBM_SETPOS, FALSE, 20); SendMessage(hWndTrackbar, TBM_SETPOS, FALSE, 20);
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
expect(20, r); expect(20, r);
SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 20);
/* test TBM_GETPOS */ /* test TBM_GETPOS */
r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0);
......
...@@ -1148,7 +1148,7 @@ TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition) ...@@ -1148,7 +1148,7 @@ TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
infoPtr->lPos = infoPtr->lRangeMax; infoPtr->lPos = infoPtr->lRangeMax;
infoPtr->flags |= TB_THUMBPOSCHANGED; infoPtr->flags |= TB_THUMBPOSCHANGED;
if (fPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); if (fPosition && oldPos != lPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment