emacs-diffs
[Top][All Lists]
Advanced

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

master 6e8bafc996: Synchronize XI2 code with Core Input code


From: Po Lu
Subject: master 6e8bafc996: Synchronize XI2 code with Core Input code
Date: Fri, 21 Jan 2022 02:33:21 -0500 (EST)

branch: master
commit 6e8bafc99698714846de29afc8fe329dd5bc92c2
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Synchronize XI2 code with Core Input code
    
    * src/xterm.c (handle_one_xevent): Apply recent changes for XI2
    events as well.
---
 src/xterm.c | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 244b11e0f7..c7d2dadff1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10285,26 +10285,33 @@ handle_one_xevent (struct x_display_info *dpyinfo,
          {
          case XI_FocusIn:
            any = x_any_window_to_frame (dpyinfo, focusin->event);
-#ifndef USE_GTK
+#ifdef USE_GTK
            /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap
               minimized/iconified windows; thus, for those WMs we won't get
-              a MapNotify when unminimizing/deconifying.  Check here if we
+              a MapNotify when unminimizing/deiconifying.  Check here if we
               are deiconizing a window (Bug42655).
 
-              But don't do that on GTK since it may cause a plain invisible
-              frame get reported as iconified, compare
+              But don't do that by default on GTK since it may cause a plain
+              invisible frame get reported as iconified, compare
               
https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00133.html.
-              That is fixed above but bites us here again.  */
-           f = any;
-           if (f && FRAME_ICONIFIED_P (f))
+              That is fixed above but bites us here again.
+
+              The option x_set_frame_visibility_more_laxly allows to override
+              the default behavior (Bug#49955, Bug#53298).  */
+           if (EQ (x_set_frame_visibility_more_laxly, Qfocus_in)
+               || EQ (x_set_frame_visibility_more_laxly, Qt))
+#endif /* USE_GTK */
              {
-               SET_FRAME_VISIBLE (f, 1);
-               SET_FRAME_ICONIFIED (f, false);
-               f->output_data.x->has_been_visible = true;
-               inev.ie.kind = DEICONIFY_EVENT;
-               XSETFRAME (inev.ie.frame_or_window, f);
+               f = any;
+               if (f && FRAME_ICONIFIED_P (f))
+                 {
+                   SET_FRAME_VISIBLE (f, 1);
+                   SET_FRAME_ICONIFIED (f, false);
+                   f->output_data.x->has_been_visible = true;
+                   inev.ie.kind = DEICONIFY_EVENT;
+                   XSETFRAME (inev.ie.frame_or_window, f);
+                 }
              }
-#endif /* USE_GTK */
            x_detect_focus_change (dpyinfo, any, event, &inev.ie);
            goto XI_OTHER;
          case XI_FocusOut:



reply via email to

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