diff options
| author | Martin Rudalics | 2016-10-17 10:52:01 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2016-10-17 10:52:01 +0200 |
| commit | 421c0512f76683e0b85ea5e1362291c2da4149ba (patch) | |
| tree | 94673c576f72fbfd01d1d3faeaf7e24d60ef4946 /src | |
| parent | 027c350e0cde1876f811b845cb10d3faa8f45665 (diff) | |
| download | emacs-421c0512f76683e0b85ea5e1362291c2da4149ba.tar.gz emacs-421c0512f76683e0b85ea5e1362291c2da4149ba.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 7 | ||||
| -rw-r--r-- | src/window.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/frame.c b/src/frame.c index 45559b0be98..a1c2199d044 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 | |||
| 1160 | if (FRAMEP (xfocus)) | 1160 | if (FRAMEP (xfocus)) |
| 1161 | { | 1161 | { |
| 1162 | focus = FRAME_FOCUS_FRAME (XFRAME (xfocus)); | 1162 | focus = FRAME_FOCUS_FRAME (XFRAME (xfocus)); |
| 1163 | if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) | 1163 | if ((FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) |
| 1164 | /* Redirect frame focus also when FRAME has its minibuffer | ||
| 1165 | window on the selected frame (see Bug#24500). */ | ||
| 1166 | || (NILP (focus) | ||
| 1167 | && EQ (FRAME_MINIBUF_WINDOW (XFRAME (frame)), | ||
| 1168 | sf->selected_window))) | ||
| 1164 | Fredirect_frame_focus (xfocus, frame); | 1169 | Fredirect_frame_focus (xfocus, frame); |
| 1165 | } | 1170 | } |
| 1166 | } | 1171 | } |
diff --git a/src/window.c b/src/window.c index 753ebc16fbf..acbefcdad16 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -2377,8 +2377,10 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, | |||
| 2377 | == FRAME_TERMINAL (XFRAME (selected_frame))); | 2377 | == FRAME_TERMINAL (XFRAME (selected_frame))); |
| 2378 | } | 2378 | } |
| 2379 | else if (WINDOWP (all_frames)) | 2379 | else if (WINDOWP (all_frames)) |
| 2380 | candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames) | 2380 | /* To qualify as candidate, it's not sufficient for WINDOW's frame |
| 2381 | || EQ (XWINDOW (all_frames)->frame, w->frame) | 2381 | to just share the minibuffer window - it must be active as well |
| 2382 | (see Bug#24500). */ | ||
| 2383 | candidate_p = (EQ (XWINDOW (all_frames)->frame, w->frame) | ||
| 2382 | || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f))); | 2384 | || EQ (XWINDOW (all_frames)->frame, FRAME_FOCUS_FRAME (f))); |
| 2383 | else if (FRAMEP (all_frames)) | 2385 | else if (FRAMEP (all_frames)) |
| 2384 | candidate_p = EQ (all_frames, w->frame); | 2386 | candidate_p = EQ (all_frames, w->frame); |