diff options
| author | Po Lu | 2022-01-10 14:36:21 +0800 |
|---|---|---|
| committer | Po Lu | 2022-01-10 14:36:21 +0800 |
| commit | f591835838be92bfe3f02754268cd7fff43fe681 (patch) | |
| tree | 78392a8b5cc0619f8f72adc01b62f8ef8f5bef09 /src | |
| parent | d5cf772cad1773f5e40f85c51199632721050f65 (diff) | |
| download | emacs-f591835838be92bfe3f02754268cd7fff43fe681.tar.gz emacs-f591835838be92bfe3f02754268cd7fff43fe681.zip | |
Don't set callbacks on XIC when adjusting spot if callbacks are off
* src/xfns.c (xic_set_preeditarea): Don't set callbacks if the
XIC style is not XIMPreeditCallbacks. (bug#53146)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/xfns.c b/src/xfns.c index 9cf6f528198..cd48419fbd3 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -2816,20 +2816,24 @@ free_frame_xic (struct frame *f) | |||
| 2816 | void | 2816 | void |
| 2817 | xic_set_preeditarea (struct window *w, int x, int y) | 2817 | xic_set_preeditarea (struct window *w, int x, int y) |
| 2818 | { | 2818 | { |
| 2819 | struct frame *f = XFRAME (w->frame); | 2819 | struct frame *f = WINDOW_XFRAME (w); |
| 2820 | XVaNestedList attr; | 2820 | XVaNestedList attr; |
| 2821 | XPoint spot; | 2821 | XPoint spot; |
| 2822 | 2822 | ||
| 2823 | if (FRAME_XIC (WINDOW_XFRAME (w))) | 2823 | if (FRAME_XIC (f)) |
| 2824 | { | 2824 | { |
| 2825 | spot.x = WINDOW_TO_FRAME_PIXEL_X (w, x) + WINDOW_LEFT_FRINGE_WIDTH (w) + WINDOW_LEFT_MARGIN_WIDTH(w); | 2825 | spot.x = WINDOW_TO_FRAME_PIXEL_X (w, x) + WINDOW_LEFT_FRINGE_WIDTH (w) + WINDOW_LEFT_MARGIN_WIDTH(w); |
| 2826 | spot.y = WINDOW_TO_FRAME_PIXEL_Y (w, y) + FONT_BASE (FRAME_FONT (f)); | 2826 | spot.y = WINDOW_TO_FRAME_PIXEL_Y (w, y) + FONT_BASE (FRAME_FONT (f)); |
| 2827 | attr = XVaCreateNestedList (0, XNSpotLocation, &spot, | 2827 | |
| 2828 | XNPreeditStartCallback, &Xxic_preedit_start_callback, | 2828 | if (FRAME_XIC_STYLE (f) & XIMPreeditCallbacks) |
| 2829 | XNPreeditDoneCallback, &Xxic_preedit_done_callback, | 2829 | attr = XVaCreateNestedList (0, XNSpotLocation, &spot, |
| 2830 | XNPreeditDrawCallback, &Xxic_preedit_draw_callback, | 2830 | XNPreeditStartCallback, &Xxic_preedit_start_callback, |
| 2831 | XNPreeditCaretCallback, &Xxic_preedit_caret_callback, | 2831 | XNPreeditDoneCallback, &Xxic_preedit_done_callback, |
| 2832 | NULL); | 2832 | XNPreeditDrawCallback, &Xxic_preedit_draw_callback, |
| 2833 | XNPreeditCaretCallback, &Xxic_preedit_caret_callback, | ||
| 2834 | NULL); | ||
| 2835 | else | ||
| 2836 | attr = XVaCreateNestedList (0, XNSpotLocation, &spot, NULL); | ||
| 2833 | XSetICValues (FRAME_XIC (f), XNPreeditAttributes, attr, NULL); | 2837 | XSetICValues (FRAME_XIC (f), XNPreeditAttributes, attr, NULL); |
| 2834 | XFree (attr); | 2838 | XFree (attr); |
| 2835 | } | 2839 | } |