[PATCH] comctl32: Dont decrease x_offset if its already 0

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Mar 15 00:29:34 CDT 2018


Using an DPI of >= 154, it possible for the x_offset to be 0 when
a WM_SETTEXT occurs and it loops for quite some time. ;)

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

diff --git a/dlls/comctl32/edit.c b/dlls/comctl32/edit.c
index 10ff5fb..aada9fc 100644
--- a/dlls/comctl32/edit.c
+++ b/dlls/comctl32/edit.c
@@ -1758,7 +1758,8 @@ static void EDIT_EM_ScrollCaret(EDITSTATE *es)
 		if (x < es->format_rect.left) {
 			goal = es->format_rect.left + format_width / HSCROLL_FRACTION;
 			do {
-				es->x_offset--;
+				if (es->x_offset)
+				    es->x_offset--;
 				x = (short)LOWORD(EDIT_EM_PosFromChar(es, es->selection_end, FALSE));
 			} while ((x < goal) && es->x_offset);
 			/* FIXME: use ScrollWindow() somehow to improve performance */
-- 
1.9.1




More information about the wine-devel mailing list