tk/bugfix-branch-for-6fcaaa6f80.patch

36 lines
1.2 KiB
Diff
Raw Normal View History

2019-09-30 11:18:32 -04:00
From 8fed49c19d7ff190c54ff8182a49ff887b56036a Mon Sep 17 00:00:00 2001
From: bll <brad.lanam.comp@gmail.com>
Date: Fri, 31 Aug 2018 15:31:13 +0000
Subject: [PATCH 301/693] bugfix branch for: [6fcaaa6f80] Fix position of
insertion cursor for ttk entry. Patch provided by Csaba Nemethi.
---
generic/ttk/ttkEntry.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 83f1a38e5..f476dc9e2 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1257,9 +1257,16 @@ static void EntryDisplay(void *clientData, Drawable d)
/* @@@ should: maybe: SetCaretPos even when blinked off */
Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight);
+ cursorX -= cursorWidth/2;
+ if (cursorX < textarea.x) {
+ cursorX = textarea.x;
+ } else if (cursorX + cursorWidth > textarea.x + textarea.width) {
+ cursorX = textarea.x + textarea.width - cursorWidth;
+ }
+
gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion);
XFillRectangle(Tk_Display(tkwin), d, gc,
- cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight);
+ cursorX, cursorY, cursorWidth, cursorHeight);
XSetClipMask(Tk_Display(tkwin), gc, None);
Tk_FreeGC(Tk_Display(tkwin), gc);
}
--
2.19.1