aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Möllmann2025-01-23 07:51:55 +0100
committerGerd Möllmann2025-01-23 07:54:48 +0100
commitb1ec006e9f9196c1f993e0373b20a5ffb548bb4f (patch)
tree376010e3faa8915382dfd5bbd1522a4433a678d8 /src
parent1dc529d4638469b828a24006dae5830dd9f794d0 (diff)
downloademacs-b1ec006e9f9196c1f993e0373b20a5ffb548bb4f.tar.gz
emacs-b1ec006e9f9196c1f993e0373b20a5ffb548bb4f.zip
Fix setting a tty's top frame when switching frames
* src/frame.c (do_switch_frame): Compare root frames correctly.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/frame.c b/src/frame.c
index c4afbe6bbb6..258bf08788f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1773,15 +1773,19 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
1773 struct tty_display_info *tty = FRAME_TTY (f); 1773 struct tty_display_info *tty = FRAME_TTY (f);
1774 Lisp_Object top_frame = tty->top_frame; 1774 Lisp_Object top_frame = tty->top_frame;
1775 1775
1776 /* Don't mark the frame garbaged if we are switching to the frame 1776 /* Switching to a frame on a different root frame is special. The
1777 that is already the top frame of that TTY. */ 1777 old root frame has to be marked invisible, and the new root
1778 if (!EQ (frame, top_frame) && root_frame (f) != XFRAME (top_frame)) 1778 frame has to be made visible. */
1779 if (!EQ (frame, top_frame)
1780 && (!FRAMEP (top_frame)
1781 || root_frame (f) != root_frame (XFRAME (top_frame))))
1779 { 1782 {
1780 struct frame *new_root = root_frame (f); 1783 struct frame *new_root = root_frame (f);
1781 SET_FRAME_VISIBLE (new_root, true); 1784 SET_FRAME_VISIBLE (new_root, true);
1782 SET_FRAME_VISIBLE (f, true); 1785 SET_FRAME_VISIBLE (f, true);
1783 1786
1784 /* Mark previously displayed frame as no longer visible. */ 1787 /* Mark previously displayed root frame as no longer
1788 visible. */
1785 if (FRAMEP (top_frame)) 1789 if (FRAMEP (top_frame))
1786 { 1790 {
1787 struct frame *top = XFRAME (top_frame); 1791 struct frame *top = XFRAME (top_frame);
@@ -1792,7 +1796,7 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
1792 1796
1793 tty->top_frame = frame; 1797 tty->top_frame = frame;
1794 1798
1795 /* FIXME: Why is it correct to set FrameCols/Rows? */ 1799 /* FIXME: Why is it correct to set FrameCols/Rows here? */
1796 if (!FRAME_PARENT_FRAME (f)) 1800 if (!FRAME_PARENT_FRAME (f))
1797 { 1801 {
1798 /* If the new TTY frame changed dimensions, we need to 1802 /* If the new TTY frame changed dimensions, we need to