[ wxwindows-Bugs-1751914 ] painting controls with uxtheme eventually stops working

SourceForge.net noreply at sourceforge.net
Fri Aug 10 04:29:30 PDT 2007


Bugs item #1751914, was opened at 2007-07-11 14:01
Message generated for change (Comment added) made by juliansmart
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1751914&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: Must fix
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Benjamin I. Williams (biwillia76)
Assigned to: Nobody/Anonymous (nobody)
Summary: painting controls with uxtheme eventually stops working

Initial Comment:

Hello,

I have encountered a problem using wxRendererNative, which on newer versions of windows in turn uses uxtheme.  This problem is probably uxtheme specific.

I have a grid control which draws check boxes for boolean fields.  After scrolling around for a while, the check boxes stop drawing.

It turns out that, because uxtheme is opening a handle and closing it for each call, the drawing eventually stops working.

The problem is is caused by the following code from src/msw/renderer.cpp-- specifically this code at the beginning of the drawing functions:

    wxUxThemeHandle hTheme(win, L"BUTTON");

In using uxtheme directly, I have discovered that, if I don't open the ux theme handle each time I paint the control (this is what wxRendererXP is doing in the above code fragment), then the control will always paint fine.

We should only open the ux theme handle once, or once for each window maximum.

Thanks,
Ben


----------------------------------------------------------------------

>Comment By: Julian Smart (juliansmart)
Date: 2007-08-10 11:29

Message:
Logged In: YES 
user_id=59495
Originator: NO

This is pretty serious; and tricky, because if we need to pass a different
2nd argument each time, how are we going to maintain one handle per window?
More info: "OpenThemeData HTHEME Limit" topic in
http://www.codeproject.com/cs/miscctrl/themedtabpage.asp?df=100&forumid=4099&exp=0&select=1445385.
Apparently you can open and close the theme 65,535 times, and then you're
out of luck. Perhaps we need a global cache, indexed by the 'class'
parameter.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1751914&group_id=9863




More information about the wx-dev mailing list