[PATCH v2] comctl32: Dont set caret position if we dont have focus

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Dec 4 23:35:12 CST 2018


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/comctl32/edit.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/edit.c b/dlls/comctl32/edit.c
index 06e1f498dc9..b54aac1f57e 100644
--- a/dlls/comctl32/edit.c
+++ b/dlls/comctl32/edit.c
@@ -1707,9 +1707,12 @@ static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action)
 static void EDIT_SetCaretPos(EDITSTATE *es, INT pos,
 			     BOOL after_wrap)
 {
-	LRESULT res = EDIT_EM_PosFromChar(es, pos, after_wrap);
-	TRACE("%d - %dx%d\n", pos, (short)LOWORD(res), (short)HIWORD(res));
-	SetCaretPos((short)LOWORD(res), (short)HIWORD(res));
+    if(es->flags & EF_FOCUSED)
+    {
+        LRESULT res = EDIT_EM_PosFromChar(es, pos, after_wrap);
+        TRACE("%d - %dx%d\n", pos, (short)LOWORD(res), (short)HIWORD(res));
+        SetCaretPos((short)LOWORD(res), (short)HIWORD(res));
+    }
 }
 
 
@@ -1778,7 +1781,6 @@ static void EDIT_EM_ScrollCaret(EDITSTATE *es)
 		}
 	}
 
-    if(es->flags & EF_FOCUSED)
 	EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP);
 }
 
-- 
2.19.2




More information about the wine-devel mailing list