]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix preeditarea reporting wrong spot.
authorAmos Bird <amosbird@gmail.com>
Thu, 25 Mar 2021 06:50:46 +0000 (14:50 +0800)
committerEli Zaretskii <eliz@gnu.org>
Thu, 25 Mar 2021 15:22:46 +0000 (17:22 +0200)
This patch adjust the x position of preeditarea with both left fringe
and left margin, which prevents IME preedit box (such as fcitx) from
placing at the wrong position in GUI emacs.
* src/xfns.c (xic_set_preeditarea): Adjust X for left margin width.
(Bug#47377)

src/xfns.c

index ab04396703e052105a5fd770532b2e1aa88b21f5..b9b396382b11d683cd53996f0b9950721c313545 100644 (file)
@@ -2785,7 +2785,7 @@ xic_set_preeditarea (struct window *w, int x, int y)
   XVaNestedList attr;
   XPoint spot;
 
-  spot.x = WINDOW_TO_FRAME_PIXEL_X (w, x) + WINDOW_LEFT_FRINGE_WIDTH (w);
+  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));
   attr = XVaCreateNestedList (0, XNSpotLocation, &spot, NULL);
   XSetICValues (FRAME_XIC (f), XNPreeditAttributes, attr, NULL);