From 16ed07ac8d5dd846f1d51dd261856d4a764b6fd0 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 10 Jan 2022 14:38:18 +0800 Subject: [PATCH] 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 cd48419fbd3..028ee29a4aa 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, -- 2.39.2