Subject: Re: bug#51883: 29.0.50; Command to get accidentally deleted frames back

From: martin rudalics <[email-masked]>
Date: Tue, 25 Jan 2022 10:28:29 +0100

> I don't yet understand the change.  I could understand why window-id
 > should be removed, but why parent-id, for example?
 >
 > Martin, any comments on this change?

The problematic part _is_ parent-id which makes the clone an "embedded"
frame, one for which FRAME_X_EMBEDDED_P (f) holds and one which Emacs
doesn't try to make visible in 'x-create-frame' because

      However, with explicit parent, Emacs
      cannot control visibility, so don't try.

Subsequent attempts to make that frame visible fail here in xterm.c

#ifdef USE_GTK
       gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
       gtk_window_deiconify (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
#else
       if (FRAME_X_EMBEDDED_P (f))
	xembed_set_info (f, XEMBED_MAPPED);
       else
	XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
#endif /* not USE_GTK */

which also explains why on GTK the frame does become visible.

So it suffices to remove only parent-id from the parameters passed to
'make-frame' (and I won't comment the idea to bind 'default-frame-alist'
when making the frame and the whole idea of 'clone-frame' - the value
returned by 'frame-parameters' is IMHO strictly not intended for feeding
it into 'make-frame' calls "just like that").

martin