[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 16ed07ac8d 2/2: Use phys cursor height instead of font base to se
From: |
Po Lu |
Subject: |
master 16ed07ac8d 2/2: Use phys cursor height instead of font base to set spot Y |
Date: |
Mon, 10 Jan 2022 01:40:09 -0500 (EST) |
branch: master
commit 16ed07ac8d5dd846f1d51dd261856d4a764b6fd0
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Use phys cursor height instead of font base to set spot Y
* src/xfns.c (xic_set_xfontset): Use `phys_cursor_height' to
avoid the spot potentially appearing at an incorrect position.
---
src/xfns.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/xfns.c b/src/xfns.c
index cd48419fbd..028ee29a4a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2822,8 +2822,11 @@ xic_set_preeditarea (struct window *w, int x, int y)
if (FRAME_XIC (f))
{
- spot.x = WINDOW_TO_FRAME_PIXEL_X (w, x) + WINDOW_LEFT_FRINGE_WIDTH (w) +
WINDOW_LEFT_MARGIN_WIDTH(w);
- spot.y = WINDOW_TO_FRAME_PIXEL_Y (w, y) + FONT_BASE (FRAME_FONT (f));
+ spot.x = (WINDOW_TO_FRAME_PIXEL_X (w, x)
+ + WINDOW_LEFT_FRINGE_WIDTH (w)
+ + WINDOW_LEFT_MARGIN_WIDTH (w));
+ spot.y = (WINDOW_TO_FRAME_PIXEL_Y (w, y)
+ + w->phys_cursor_height);
if (FRAME_XIC_STYLE (f) & XIMPreeditCallbacks)
attr = XVaCreateNestedList (0, XNSpotLocation, &spot,