GNU bug report logs - #47377
[PATCH] Fix preeditarea reporting wrong spot

Previous Next

Package: emacs;

Reported by: Amos Bird <amosbird <at> gmail.com>

Date: Thu, 25 Mar 2021 06:56:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Amos Bird <amosbird <at> gmail.com>
Subject: bug#47377: closed (Re: bug#47377: [PATCH] Fix preeditarea
 reporting wrong spot)
Date: Thu, 25 Mar 2021 15:27:02 +0000
[Message part 1 (text/plain, inline)]
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 47377 <at> debbugs.gnu.org.

-- 
47377: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47377
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Amos Bird <amosbird <at> gmail.com>
Cc: 47377-done <at> debbugs.gnu.org
Subject: Re: bug#47377: [PATCH] Fix preeditarea reporting wrong spot
Date: Thu, 25 Mar 2021 17:26:00 +0200
> From: Amos Bird <amosbird <at> gmail.com>
> 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.

[Message part 3 (message/rfc822, inline)]
From: Amos Bird <amosbird <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix preeditarea reporting wrong spot
Date: Thu, 25 Mar 2021 14:57:13 +0800
[Message part 4 (text/plain, inline)]
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

[0001-Fix-preeditarea-reporting-wrong-spot.patch (text/x-patch, inline)]
From 769adf8858c067e779c07087f53048455ff1c7f3 Mon Sep 17 00:00:00 2001
From: Amos Bird <amosbird <at> gmail.com>
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


This bug report was last modified 4 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.