Subject: bug#77079: closed (Re: 31.0.50; Re-parenting tty child frame leaves two instances on display)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 19 Mar 2025 08:44:05 +0000

Your bug report

#77079: 31.0.50; Re-parenting tty child frame leaves two instances on display

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
77079: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77079
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: 31.0.50; Re-parenting tty child frame leaves two instances on display
From: martin rudalics <[email-masked]>
To: Gerd Möllmann <[email-masked]>
Cc: [email-masked]
Date: Wed, 19 Mar 2025 09:43:24 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Closing this bug.

martin

Subject: 31.0.50; Re-parenting tty child frame leaves two instances on display
From: martin rudalics <[email-masked]>
To: Bug-Gnu-Emacs <[email-masked]>
Cc: Gerd Möllmann <[email-masked]>
Date: Mon, 17 Mar 2025 19:52:41 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

I think we need the following change

diff --git a/src/frame.c b/src/frame.c
index c1ef26e5dd4..9a4ca7d0682 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3706,6 +3706,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
        if (NILP (f->parent_frame) != NILP (val))
  	error ("Making a root frame a child or vice versa is not supported");
        f->parent_frame = val;
+      SET_FRAME_GARBAGED (root_frame (f));
      }

    /* The tty color needed to be set before the frame's parameter

since otherwise re-parenting a child frame, for example, using

(set-frame-parameter tty-3 'parent-frame tty-1)

from my earlier tty-child-frames.el leaves one with two instances of the
child frame on display.

martin