[PATCH] user32: use InvalidateRect to repaint buttons

Nikolay Sivov bunglehead at gmail.com
Sun Feb 15 09:59:42 CST 2015


On 11.02.2015 0:48, Mark Harmstone wrote:
> At present, whenever a button needs to be redrawn user32 calls its own
> internal function. This causes problems if the button is subclassed, as
> the superclass then won't receive the WM_PAINT message - this is why
> themed buttons lose their theme when you click on them. This patch changes
> it to instead call InvalidateRect, which will force a WM_PAINT message
> to be sent to the topmost class.
>
> ---
>   dlls/user32/button.c | 17 ++++++++---------
>   1 file changed, 8 insertions(+), 9 deletions(-)
>

That sounds like a case when proper fix is to reimplement themed 
controls in comctl32, the way Windows does that. I remember when I 
copied over tests for buttons to comctl32/tests I had to fix painting 
sequences too.

To make it work properly we'll need to make comctl32 register separate 
classes, when loaded within context, or even better - to build two 
separate modules like windows does. Those separate classes should be 
named as "Classname!x.x.x.x", where x.x.x.x is a comctl32 version. After 
this done user32 needs to be fixed at CreateWindow() level to properly 
forward to those classes.



More information about the wine-devel mailing list