[MSW] wxStaticBox flickering since 2.9.x
|Reported by:||ericj||Owned by:|
Since 2.9.x items in a wxStaticBox flicker heavily, this wasn't the case in wx 2.8.x.
I added a patch to the minimal sample to show the issue. The two screenshots show the initial display. To increase the visual effect, i set the background color of the main panel to green and the wxStaticBox to red.
The first difference is obvious, in 2.8.x the background color of the panel shines through the wxStaticBox. This is probably because wxStaticBox had the WS_EX_TRANSPARENT style in 2.8.x
Clicking on any of the buttons will force 50 redraws of the panel. This does not flicker in 2.8.x, but flickers heavily in 2.9.x as the background of the panel is completely drawn and then the buttons are drawn on top.
I noticed that the flicker disappears if you set background style of the wxStaticBox to wxBG_STYLE_CUSTOM *and* create the items in the wxStaticBox as siblings, not children of it.
My theory what happens:
In 2.9.x the SB was transparent, so its background wasn't drawn. Setting the background style to wxBG_STYLE_CUSTOM has the same effect.
In src/msw/statbox.cpp there is the method wxStaticBox::MSWGetRegionWithoutChildren(). This works as intended if the items in the SB are siblings of it (as mandatory in 2.8.x). In 2.9. it's recommended to create the items as children of the SB, but this method was not adjusted accordingly as it only processes the siblings of the SB. (I'm not 100% sure about this).
Change History (10)
comment:3 Changed 20 months ago by ericj
- Patch set
- Resolution wontfix deleted
- Status changed from closed to reopened
Changed 20 months ago by ericj
comment:5 Changed 20 months ago by VZ
- Resolution set to fixed
- Status changed from confirmed to closed