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.
http://bugs.winehq.org/show_bug.cgi?id=36694
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- Created attachment 48737 --> http://bugs.winehq.org/attachment.cgi?id=48737 patch
Try this patch please. It's a cumulative diff from 3 patches I have in my tree.
http://bugs.winehq.org/show_bug.cgi?id=36694
--- Comment #2 from Nikolay Sivov bunglehead@gmail.com --- Some patches got in:
25279d310e90a90c7584111932b014f035c3f203 c69a7ecfb6c2ca6e9844a567c4dfe58f6f7070d6 2a348791ee56c6556887a64d98eea68aaa01cc01
Still needs more work:
- PBM_GETPOS should always return 1 for PBS_MARQUEE style; - setting PBS_MARQUEE (or resetting?) sets current position to 0, so going back to normal progress mode always starts with position 0; - when in PBS_MARQUEE each window redraw cycle moves progress animation one steps. So when you change window size or minimize/maximize progress bar is updated; - mostly likely more differences..
https://bugs.winehq.org/show_bug.cgi?id=36694
--- Comment #3 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=36694
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=36694
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #48737|0 |1 is obsolete| |
--- Comment #4 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Comment on attachment 48737 --> https://bugs.winehq.org/attachment.cgi?id=48737 patch
This patch has been applied to upstream.
https://bugs.winehq.org/show_bug.cgi?id=36694
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|patch |