unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47377: [PATCH] Fix preeditarea reporting wrong spot
@ 2021-03-25  6:57 Amos Bird
  2021-03-25 15:26 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Amos Bird @ 2021-03-25  6:57 UTC (permalink / raw)
  To: 47377

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]


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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-preeditarea-reporting-wrong-spot.patch --]
[-- Type: text/x-patch, Size: 1074 bytes --]

From 769adf8858c067e779c07087f53048455ff1c7f3 Mon Sep 17 00:00:00 2001
From: Amos Bird <amosbird@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#47377: [PATCH] Fix preeditarea reporting wrong spot
  2021-03-25  6:57 bug#47377: [PATCH] Fix preeditarea reporting wrong spot Amos Bird
@ 2021-03-25 15:26 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2021-03-25 15:26 UTC (permalink / raw)
  To: Amos Bird; +Cc: 47377-done

> From: Amos Bird <amosbird@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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-25 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25  6:57 bug#47377: [PATCH] Fix preeditarea reporting wrong spot Amos Bird
2021-03-25 15:26 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).