[PATCH 1/2] riched20: Don't call UpdateWindow after setting the background color.

Alex Henrie alexhenrie24 at gmail.com
Thu May 5 22:04:47 CDT 2016


Cc: Huw Davies <huw at codeweavers.com>

Fixes https://bugs.winehq.org/show_bug.cgi?id=40532

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/riched20/editor.c       |  1 -
 dlls/riched20/tests/editor.c | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 7ac94ca..85395e7 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -3626,7 +3626,6 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
       editor->hbrBackground = CreateSolidBrush(editor->rgbBackColor);
     }
     ITextHost_TxInvalidateRect(editor->texthost, NULL, TRUE);
-    ITextHost_TxViewChange(editor->texthost, TRUE);
     return lColor;
   }
   case EM_GETMODIFY:
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index ae9c0a5..5c41116 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -8337,6 +8337,20 @@ static void test_rtf_specials(void)
     DestroyWindow( edit );
 }
 
+static void test_background(void)
+{
+    HWND hwndRichEdit = new_richedit(NULL);
+    RECT updateRect;
+
+    /* set the background color to black */
+    ValidateRect(hwndRichEdit, NULL);
+    SendMessageA(hwndRichEdit, EM_SETBKGNDCOLOR, FALSE, 0);
+    GetUpdateRect(hwndRichEdit, &updateRect, FALSE);
+    ok(!IsRectEmpty(&updateRect), "The update rect should not be empty\n");
+
+    DestroyWindow(hwndRichEdit);
+}
+
 
 START_TEST( editor )
 {
@@ -8408,6 +8422,7 @@ START_TEST( editor )
   test_EM_SETFONTSIZE();
   test_alignment_style();
   test_rtf_specials();
+  test_background();
 
   /* Set the environment variable WINETEST_RICHED20 to keep windows
    * responsive and open for 30 seconds. This is useful for debugging.
-- 
2.8.2




More information about the wine-patches mailing list