riched20: Explicitly select the background brush.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2021-03-23 13:04:05 +00:00 committed by Alexandre Julliard
parent 393b18ab7a
commit a19cecacda
1 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,9 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
ME_Cell *cell;
int ys, ye;
HRGN oldRgn;
HBRUSH brush = CreateSolidBrush( ITextHost_TxGetSysColor( editor->texthost, COLOR_WINDOW ) );
ME_InitContext( &c, editor, hDC );
oldRgn = CreateRectRgn(0, 0, 0, 0);
if (!GetClipRgn(hDC, oldRgn))
@ -42,7 +45,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
IntersectClipRect(hDC, rcUpdate->left, rcUpdate->top,
rcUpdate->right, rcUpdate->bottom);
ME_InitContext(&c, editor, hDC);
brush = SelectObject( hDC, brush );
SetBkMode(hDC, TRANSPARENT);
para = editor_first_para( editor );
@ -89,6 +92,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
editor->nLastTotalLength = editor->nTotalLength;
editor->nLastTotalWidth = editor->nTotalWidth;
DeleteObject( SelectObject( hDC, brush ) );
SelectClipRgn(hDC, oldRgn);
if (oldRgn)
DeleteObject(oldRgn);