user32: Do not ask DrawFrameControl() to modify the passed in rectangle.
This patch should fix the regression(s) caused by my recent button painting patches. The problem was that DrawFrameControl() was modifying the rectangle, and one of my patches stopped calling DrawFrameControl() in case of ODA_FOCUS action, so drawing an entire button and only focus started to differ, which was hidden by the custom clipping (that was removed by my last patch).
This commit is contained in:
parent
7a9ba819e7
commit
c049f83308
|
@ -769,7 +769,7 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, const RECT *rc)
|
||||||
*/
|
*/
|
||||||
static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
|
static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
{
|
{
|
||||||
RECT rc, focus_rect, r;
|
RECT rc, r;
|
||||||
UINT dtFlags, uState;
|
UINT dtFlags, uState;
|
||||||
HPEN hOldPen;
|
HPEN hOldPen;
|
||||||
HBRUSH hOldBrush;
|
HBRUSH hOldBrush;
|
||||||
|
@ -802,12 +802,10 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
|
||||||
InflateRect( &rc, -1, -1 );
|
InflateRect( &rc, -1, -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
focus_rect = rc;
|
|
||||||
|
|
||||||
/* completely skip the drawing if only focus has changed */
|
/* completely skip the drawing if only focus has changed */
|
||||||
if (action == ODA_FOCUS) goto draw_focus;
|
if (action == ODA_FOCUS) goto draw_focus;
|
||||||
|
|
||||||
uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT;
|
uState = DFCS_BUTTONPUSH;
|
||||||
|
|
||||||
if (style & BS_FLAT)
|
if (style & BS_FLAT)
|
||||||
uState |= DFCS_MONO;
|
uState |= DFCS_MONO;
|
||||||
|
@ -844,8 +842,8 @@ draw_focus:
|
||||||
if ((action == ODA_FOCUS) ||
|
if ((action == ODA_FOCUS) ||
|
||||||
((action == ODA_DRAWENTIRE) && (state & BUTTON_HASFOCUS)))
|
((action == ODA_DRAWENTIRE) && (state & BUTTON_HASFOCUS)))
|
||||||
{
|
{
|
||||||
InflateRect( &focus_rect, -1, -1 );
|
InflateRect( &rc, -2, -2 );
|
||||||
DrawFocusRect( hDC, &focus_rect );
|
DrawFocusRect( hDC, &rc );
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
Loading…
Reference in New Issue