aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-13 18:58:42 +0800
committerPo Lu2022-03-13 19:05:04 +0800
commit676dffff4b063cf4f7667bd0ca6ded3a03704d2c (patch)
tree50f1c2b442a273c0ac0ea98b1df2eed7d02bb21e /src
parentc6287816f2af5a954d735fa62ce714db2067a3db (diff)
downloademacs-676dffff4b063cf4f7667bd0ca6ded3a03704d2c.tar.gz
emacs-676dffff4b063cf4f7667bd0ca6ded3a03704d2c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 18a8d5b431a..397b5bfc7a8 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11038,6 +11038,15 @@ handle_one_xevent (struct x_display_info *dpyinfo,
11038 } 11038 }
11039 done_keysym: 11039 done_keysym:
11040#ifdef HAVE_X_I18N 11040#ifdef HAVE_X_I18N
11041 if (f)
11042 {
11043 struct window *w = XWINDOW (f->selected_window);
11044 xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
11045
11046 if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
11047 xic_set_statusarea (f);
11048 }
11049
11041 /* Don't dispatch this event since XtDispatchEvent calls 11050 /* Don't dispatch this event since XtDispatchEvent calls
11042 XFilterEvent, and two calls in a row may freeze the 11051 XFilterEvent, and two calls in a row may freeze the
11043 client. */ 11052 client. */
@@ -11507,11 +11516,11 @@ handle_one_xevent (struct x_display_info *dpyinfo,
11507 11516
11508 11517
11509#ifdef HAVE_X_I18N 11518#ifdef HAVE_X_I18N
11510 if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
11511 xic_set_statusarea (f);
11512
11513 if (f) 11519 if (f)
11514 { 11520 {
11521 if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
11522 xic_set_statusarea (f);
11523
11515 struct window *w = XWINDOW (f->selected_window); 11524 struct window *w = XWINDOW (f->selected_window);
11516 xic_set_preeditarea (w, w->cursor.x, w->cursor.y); 11525 xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
11517 } 11526 }
@@ -13598,8 +13607,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
13598 13607
13599 xi_done_keysym: 13608 xi_done_keysym:
13600#ifdef HAVE_X_I18N 13609#ifdef HAVE_X_I18N
13601 if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea)) 13610 if (f)
13602 xic_set_statusarea (f); 13611 {
13612 struct window *w = XWINDOW (f->selected_window);
13613 xic_set_preeditarea (w, w->cursor.x, w->cursor.y);
13614
13615 if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
13616 xic_set_statusarea (f);
13617 }
13603#endif 13618#endif
13604 if (must_free_data) 13619 if (must_free_data)
13605 XFreeEventData (dpyinfo->display, &event->xcookie); 13620 XFreeEventData (dpyinfo->display, &event->xcookie);