Subject: bug#55103: 29.0.50; Server mode + reuseable-frames + switch-to-buffer-other-window + *scratch* => hang

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 25 Apr 2022 09:56:45 +0200

Derek Upham <[email-masked]> writes:

> * Starting Emacs in server mode allocates a headless terminal frame
> ("F1").  That hidden frame contains a window that displays *scratch*
> (because that's the default thing to display).
>
> * The reuseable-frames parameter directs Emacs to reuse that terminal
> frame.  After all, the frame is showing the *scratch* buffer.  It's a
> valid candidate according to the code.
>
> * Emacs can't actually display the headless terminal frame.  It hangs.
>
> At it's broadest, the bug here is that the reuseable-frames logic
> doesn't understand that there are frames that you will never see in your
> display, and that the code should avoid them.  The most conservative
> approach is to filter out any frame not handled by on your display.
> That has interesting implications for X11, where two X11 frames look the
> same to the user, whether or not they share the same client connection.
> ("Why is this not reusing my frame that's right there?")

Yes, I don't think Emacs can, in general, know whether a frame is
visible on the same actual display as another frame.

But in this case, I think it should be possible to avoid that initial
dummy frame, surely.  I've added Martin to the CCs; perhaps he has some
comments here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no