emacs-diffs
[Top][All Lists]
Advanced

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

master 7e612a26a8: Only get rid of IC focus if focus is really gone


From: Po Lu
Subject: master 7e612a26a8: Only get rid of IC focus if focus is really gone
Date: Sun, 13 Feb 2022 06:52:02 -0500 (EST)

branch: master
commit 7e612a26a8697a984980f15a8ffefd90e8c34d36
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/xterm.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index fe213b0fab..b8d0a2b58b 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);
     }



reply via email to

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