emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 676dffff4b: Fix setting IM spot after key press events


From: Po Lu
Subject: master 676dffff4b: Fix setting IM spot after key press events
Date: Sun, 13 Mar 2022 07:05:16 -0400 (EDT)

branch: master
commit 676dffff4b063cf4f7667bd0ca6ded3a03704d2c
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix setting IM spot after key press events
    
    * src/xterm.c (handle_one_xevent): Check f is not NULL before
    trying to set its status area and set preedit spot location
    after KeyPress events.
---
 src/xterm.c | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 18a8d5b431..397b5bfc7a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11038,6 +11038,15 @@ handle_one_xevent (struct x_display_info *dpyinfo,
         }
     done_keysym:
 #ifdef HAVE_X_I18N
+      if (f)
+       {
+         struct window *w = XWINDOW (f->selected_window);
+         xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
+
+         if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
+            xic_set_statusarea (f);
+       }
+
       /* Don't dispatch this event since XtDispatchEvent calls
          XFilterEvent, and two calls in a row may freeze the
          client.  */
@@ -11507,11 +11516,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
 
 #ifdef HAVE_X_I18N
-          if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
-            xic_set_statusarea (f);
-
          if (f)
            {
+             if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
+               xic_set_statusarea (f);
+
              struct window *w = XWINDOW (f->selected_window);
              xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
            }
@@ -13598,8 +13607,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
       xi_done_keysym:
 #ifdef HAVE_X_I18N
-       if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
-         xic_set_statusarea (f);
+      if (f)
+       {
+         struct window *w = XWINDOW (f->selected_window);
+         xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
+
+         if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
+            xic_set_statusarea (f);
+       }
 #endif
        if (must_free_data)
          XFreeEventData (dpyinfo->display, &event->xcookie);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]