Skip to content

Commit fc9e7ba

Browse files
yagoulasJoachimHenze
authored andcommitted
[0.4.11] [COMCTL32] button: Don't erase the area of the checkbox or the text.
Attempt to fix the menace of the world, CORE-13278. Note that this can also cause visual glitches for classic check boxes or radio buttons. This commit does not fix the flickering to 100%, but it does greatly reduce it. I will watch out during release tests, whether anything is negatively impacted, and if yes, I might withdraw the patch. Up to now I did not spot any problems. cherry picked from commit 0.4.12-dev-347-g 75a80ec
1 parent 1d47cfd commit fc9e7ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dll/win32/comctl32/button.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,9 @@ static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action )
15501550

15511551
/* Since WM_ERASEBKGND does nothing, first prepare background */
15521552
if (action == ODA_SELECT) FillRect( hDC, &rbox, hBrush );
1553+
#ifndef __REACTOS__
15531554
if (action == ODA_DRAWENTIRE) FillRect( hDC, &client, hBrush );
1555+
#endif
15541556

15551557
/* Draw label */
15561558
client = rtext;
@@ -1616,6 +1618,15 @@ static void CB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action )
16161618
if (action == ODA_DRAWENTIRE)
16171619
BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &rtext);
16181620

1621+
#ifdef __REACTOS__
1622+
if (action == ODA_DRAWENTIRE)
1623+
{
1624+
ExcludeClipRect(hDC, rbox.left, rbox.top, rbox.right, rbox.bottom);
1625+
ExcludeClipRect(hDC, rtext.left, rtext.top + 1, rtext.right, rtext.bottom - 1);
1626+
FillRect( hDC, &client, hBrush );
1627+
}
1628+
#endif
1629+
16191630
/* ... and focus */
16201631
if (action == ODA_FOCUS || (state & BST_FOCUS))
16211632
{

0 commit comments

Comments
 (0)