From: Po Lu Date: Sun, 13 Feb 2022 11:50:20 +0000 (+0800) Subject: Only get rid of IC focus if focus is really gone X-Git-Tag: emacs-29.0.90~2337 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7e612a26a8697a984980f15a8ffefd90e8c34d36;p=emacs.git Only get rid of IC focus if focus is really gone * src/xterm.c (x_focus_changed): Only unset IC focus if the focus state is empty. --- diff --git a/src/xterm.c b/src/xterm.c index fe213b0fabb..b8d0a2b58b6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5559,17 +5559,21 @@ x_focus_changed (int type, int state, struct x_display_info *dpyinfo, struct fra XSETFRAME (bufp->frame_or_window, frame); } + if (!frame->output_data.x->focus_state) + { #ifdef HAVE_X_I18N - if (FRAME_XIC (frame)) - XUnsetICFocus (FRAME_XIC (frame)); + if (FRAME_XIC (frame)) + XUnsetICFocus (FRAME_XIC (frame)); #ifdef USE_GTK - if (x_gtk_use_native_input) - { - gtk_im_context_focus_out (FRAME_X_OUTPUT (frame)->im_context); - gtk_im_context_set_client_window (FRAME_X_OUTPUT (frame)->im_context, NULL); - } + if (x_gtk_use_native_input) + { + gtk_im_context_focus_out (FRAME_X_OUTPUT (frame)->im_context); + gtk_im_context_set_client_window (FRAME_X_OUTPUT (frame)->im_context, NULL); + } #endif #endif + } + if (frame->pointer_invisible) XTtoggle_invisible_pointer (frame, false); }