diff options
| author | Alan Mackenzie | 2022-07-07 15:38:09 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2022-07-07 15:38:09 +0000 |
| commit | 9cd72b02b67e92e89b83791b66fe40c4b50d8357 (patch) | |
| tree | 8617865bcda9b747dc7d08742a573b815a208643 /src | |
| parent | f32808ce98d0612bc5ad949f41563001768ab87a (diff) | |
| download | emacs-9cd72b02b67e92e89b83791b66fe40c4b50d8357.tar.gz emacs-9cd72b02b67e92e89b83791b66fe40c4b50d8357.zip | |
Remove obscure, obsolete code from do_switch_frame
This is relevant for bug #56305, and might solve that bug. The code being
removed went into Emacs between 1992 and 1994, and looks to have been a
workaround for switching frames, before the command 'other-frame' had been
written. Nowadays, that code has harmful effects, causing frames' focus to be
redirected at random, sometimes back to the frame itself.
* src/frame.c (do_switch_frame): Remove 53 lines of code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/frame.c b/src/frame.c index 02c90ea6519..4828595b935 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1477,59 +1477,6 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor | |||
| 1477 | else if (f == sf) | 1477 | else if (f == sf) |
| 1478 | return frame; | 1478 | return frame; |
| 1479 | 1479 | ||
| 1480 | /* If a frame's focus has been redirected toward the currently | ||
| 1481 | selected frame, we should change the redirection to point to the | ||
| 1482 | newly selected frame. This means that if the focus is redirected | ||
| 1483 | from a minibufferless frame to a surrogate minibuffer frame, we | ||
| 1484 | can use `other-window' to switch between all the frames using | ||
| 1485 | that minibuffer frame, and the focus redirection will follow us | ||
| 1486 | around. */ | ||
| 1487 | #if 0 | ||
| 1488 | /* This is too greedy; it causes inappropriate focus redirection | ||
| 1489 | that's hard to get rid of. */ | ||
| 1490 | if (track) | ||
| 1491 | { | ||
| 1492 | Lisp_Object tail; | ||
| 1493 | |||
| 1494 | for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) | ||
| 1495 | { | ||
| 1496 | Lisp_Object focus; | ||
| 1497 | |||
| 1498 | if (!FRAMEP (XCAR (tail))) | ||
| 1499 | emacs_abort (); | ||
| 1500 | |||
| 1501 | focus = FRAME_FOCUS_FRAME (XFRAME (XCAR (tail))); | ||
| 1502 | |||
| 1503 | if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) | ||
| 1504 | Fredirect_frame_focus (XCAR (tail), frame); | ||
| 1505 | } | ||
| 1506 | } | ||
| 1507 | #else /* ! 0 */ | ||
| 1508 | /* Instead, apply it only to the frame we're pointing to. */ | ||
| 1509 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 1510 | if (track && FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->get_focus_frame) | ||
| 1511 | { | ||
| 1512 | Lisp_Object focus, gfocus; | ||
| 1513 | |||
| 1514 | gfocus = FRAME_TERMINAL (f)->get_focus_frame (f); | ||
| 1515 | if (FRAMEP (gfocus)) | ||
| 1516 | { | ||
| 1517 | focus = FRAME_FOCUS_FRAME (XFRAME (gfocus)); | ||
| 1518 | if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) | ||
| 1519 | /* Redirect frame focus also when FRAME has its minibuffer | ||
| 1520 | window on the selected frame (see Bug#24500). | ||
| 1521 | |||
| 1522 | Don't do that: It causes redirection problem with a | ||
| 1523 | separate minibuffer frame (Bug#24803) and problems | ||
| 1524 | when updating the cursor on such frames. | ||
| 1525 | || (NILP (focus) | ||
| 1526 | && EQ (FRAME_MINIBUF_WINDOW (f), sf->selected_window))) */ | ||
| 1527 | Fredirect_frame_focus (gfocus, frame); | ||
| 1528 | } | ||
| 1529 | } | ||
| 1530 | #endif /* HAVE_X_WINDOWS */ | ||
| 1531 | #endif /* ! 0 */ | ||
| 1532 | |||
| 1533 | if (!for_deletion && FRAME_HAS_MINIBUF_P (sf)) | 1480 | if (!for_deletion && FRAME_HAS_MINIBUF_P (sf)) |
| 1534 | resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1); | 1481 | resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1); |
| 1535 | 1482 | ||