emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 421c051: Fix frame focus redirection with shared mi


From: Martin Rudalics
Subject: [Emacs-diffs] master 421c051: Fix frame focus redirection with shared minibuffer windows (Bug#24500)
Date: Mon, 17 Oct 2016 08:52:44 +0000 (UTC)

branch: master
commit 421c0512f76683e0b85ea5e1362291c2da4149ba
Author: Martin Rudalics <address@hidden>
Commit: Martin Rudalics <address@hidden>

    Fix frame focus redirection with shared minibuffer windows (Bug#24500)
    
    * src/frame.c (do_switch_frame): Redirect frame focus also when
    the frame switched to has its minibuffer window on the selected
    frame.
    * src/window.c (candidate_window_p): To qualify as candidate
    it's not sufficient for the window's frame to just share the
    minibuffer window - it must be active as well.
---
 src/frame.c  |    7 ++++++-
 src/window.c |    6 ++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/frame.c b/src/frame.c
index 45559b0..a1c2199 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1160,7 +1160,12 @@ do_switch_frame (Lisp_Object frame, int track, int 
for_deletion, Lisp_Object nor
       if (FRAMEP (xfocus))
        {
          focus = FRAME_FOCUS_FRAME (XFRAME (xfocus));
-         if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
+         if ((FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
+             /* Redirect frame focus also when FRAME has its minibuffer
+                window on the selected frame (see Bug#24500).  */
+             || (NILP (focus)
+                 && EQ (FRAME_MINIBUF_WINDOW (XFRAME (frame)),
+                        sf->selected_window)))
            Fredirect_frame_focus (xfocus, frame);
        }
     }
diff --git a/src/window.c b/src/window.c
index 753ebc1..acbefcd 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2377,8 +2377,10 @@ candidate_window_p (Lisp_Object window, Lisp_Object 
owindow,
            == FRAME_TERMINAL (XFRAME (selected_frame)));
     }
   else if (WINDOWP (all_frames))
-    candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames)
-                  || EQ (XWINDOW (all_frames)->frame, w->frame)
+    /*         To qualify as candidate, it's not sufficient for WINDOW's frame
+       to just share the minibuffer window - it must be active as well
+       (see Bug#24500).  */
+    candidate_p = (EQ (XWINDOW (all_frames)->frame, w->frame)
                   || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f)));
   else if (FRAMEP (all_frames))
     candidate_p = EQ (all_frames, w->frame);



reply via email to

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