Huw Davies : riched20: Explicitly select the background brush.

Alexandre Julliard julliard at winehq.org
Tue Mar 23 16:54:31 CDT 2021


Module: wine
Branch: master
Commit: a19cecacdae2c301fffca62f4d7d9bde0e68584f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a19cecacdae2c301fffca62f4d7d9bde0e68584f

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue Mar 23 13:04:05 2021 +0000

riched20: Explicitly select the background brush.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/riched20/paint.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index bdf129b80a0..0d9916cd206 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -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);




More information about the wine-cvs mailing list