Subject: bug#47377: closed (Re: bug#47377: [PATCH] Fix preeditarea reporting wrong spot)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 25 Mar 2021 15:27:02 +0000

Your bug report

#47377: [PATCH] Fix preeditarea reporting wrong spot

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
47377: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47377
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#47377: [PATCH] Fix preeditarea reporting wrong spot
From: Eli Zaretskii <[email-masked]>
To: Amos Bird <[email-masked]>
Cc: [email-masked]
Date: Thu, 25 Mar 2021 17:26:00 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Amos Bird <[email-masked]>
> Date: Thu, 25 Mar 2021 14:57:13 +0800
> 
> 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.
> 
> This fixes the bug described in 
> https://lists.defectivebydesign.org/archive/html/emacs-devel/2017-02/msg00817.html
> 
> I've already assigned the form for contributing to emacs.

Thanks, installed.

Subject: [PATCH] Fix preeditarea reporting wrong spot
From: Amos Bird <[email-masked]>
To: [email-masked]
Date: Thu, 25 Mar 2021 14:57:13 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

This fixes the bug described in 
https://lists.defectivebydesign.org/archive/html/emacs-devel/2017-02/msg00817.html

I've already assigned the form for contributing to emacs.

regards,
Amos

>From 769adf8858c067e779c07087f53048455ff1c7f3 Mon Sep 17 00:00:00 2001
From: Amos Bird <[email-masked]>
Date: Thu, 25 Mar 2021 14:50:46 +0800
Subject: [PATCH] Fix preeditarea reporting wrong spot.

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xfns.c b/src/xfns.c
index d90644819b..0507dc8f61 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2783,7 +2783,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);
-- 
2.31.0