Subject: Re: bug#59522: 29.0.50; `C-x C-c' on undeleted frame closes Emacs server

From: Eli Zaretskii <[email-masked]>
Date: Wed, 23 Nov 2022 22:06:58 +0200

> From: Igor Epstein <[email-masked]>
> Date: Wed, 23 Nov 2022 15:40:32 +0200
> 
> Hello. There is a sequence of actions that triggers shutting down Emacs
> server when using undelete frame and `C-x C-c' it.
> 1. Start with the following init.el:
> (require 'server)
> (unless (server-running-p) (server-start))
> (undelete-frame-mode)
> 2. In a graphical terminal emulator, run `emacs'
> 3. In another window of a terminal emulator, run `emacsclient -c'
> 4. Ensure the second frame is selected, use `C-x C-c'
> 5. Undelete the frame and again use `C-x C-c' inside the undeleted frame
> 6. Observe that both frames are now closed
> 7. Running `emacsclient -c' produces "can't find socket; have you
> started the server?"

I'm not sure I understand the expectation that the above should not shut
down Emacs.  The first "C-x C-c" doesn't do that because you are typing
this in a client frame.  But when you undelete that frame, Emacs cannot make
it a client frame, because it cannot restore connection to emacsclient.  So
it makes an ordinary frame, and then "C-x C-c" shuts down Emacs.

So I' not sure I see a bug here, perhaps just a surprising behavior.  Bottom
line is that undeleting a frame doesn't restore all frame attributes of that
frame.