http://bugs.winehq.org/show_bug.cgi?id=36694
Bug ID: 36694 Summary: Using PBM_SETPOS to change the position of a progress bar to what it was before after a style change (for instance, leaving marquee mode) does not redraw the progress bar Product: Wine Version: 1.7.19 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comctl32 Assignee: wine-bugs@winehq.org Reporter: pietro10@mac.com
Created attachment 48733 --> http://bugs.winehq.org/attachment.cgi?id=48733 The test program that can be used to duplicate this behavior.
If you do this when you switch out of marquee mode on a progress bar:
SendMessage(pbar, PBM_SETMARQUEE, FALSE, 0); SetWindowLongPtr(pbar, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~PBS_MARQUEE); SendMessage(pbar, PBM_SETPOS, currentPos, 0);
the progress bar will not redraw, and thus will continue to show the marquee animation frozen at the place it was at the time of the above call.
Attached is a sample program that will demonstrate this behavior. Set one value, then click Marquee and Set again. On Windows XP (at least), the progress bar will redraw properly with the second click of Set. The attached file is also available at https://github.com/andlabs/misctestprogs/blob/master/winprogresstest.c.
(As marquees are a comctl32 version 6 feature, you may need a manifest file.)
Looking at the soruce, I see here - http://source.winehq.org/source/dlls/comctl32/progress.c#L639 - that the implementation's handling of PBM_SETPOS only draws the progressbar if the new position is different. Thus, I could come up with a variety of ways to fix it, such as adding a style change check there, or always redrawing the progress bar, or redrawing on a style change... but I don't know which is the most correct, so I'll leave it to the experts.
Thanks.