From ac5110131493b8b05795e8825285e41ca40ab6f1 Mon Sep 17 00:00:00 2001 From: Jinoh Kang Date: Sat, 1 Jul 2023 13:36:17 +0900 Subject: [PATCH] riched20: Don't call ME_UpdateRepaint inside set_selection(). This partially reverts c5daf6a30f21 (riched20: Call ME_UpdateRepaint instead of editor_ensure_visible in set_selection.) Fixes: c5daf6a30f21acd20263692b278acba49e014cc1 --- dlls/riched20/editor.c | 3 ++- dlls/riched20/tests/txtsrv.c | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 5cf43f4e29a..201c4435453 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2148,9 +2148,10 @@ int set_selection( ME_TextEditor *editor, int to, int from ) if (!editor->bHideSelection) ME_InvalidateSelection( editor ); end = set_selection_cursors( editor, to, from ); - ME_UpdateRepaint( editor, FALSE ); + editor_ensure_visible( editor, &editor->pCursors[0] ); if (!editor->bHideSelection) ME_InvalidateSelection( editor ); update_caret( editor ); + ME_Repaint( editor ); ME_SendSelChange( editor ); return end; diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c index ec2997cb2df..adb36642f4f 100644 --- a/dlls/riched20/tests/txtsrv.c +++ b/dlls/riched20/tests/txtsrv.c @@ -1303,7 +1303,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); todo_wine ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); @@ -1322,7 +1321,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent); @@ -1353,7 +1351,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); ok(en_selchange_sent == 1, "got %d\n", en_selchange_sent); @@ -1371,7 +1368,6 @@ static void test_set_selection_message( void ) ok( hr == S_OK, "got %08lx\n", hr ); CHECK_CALLED(ITextHostImpl_TxViewChange); - todo_wine ok(en_change_sent == 0, "got %d\n", en_change_sent); ok(en_selchange_sent == 0, "got %d\n", en_selchange_sent);