Subject: bug#4566: 23, NS: frames re-appear when app switching

From: Alan Third <[email-masked]>
Date: Sat, 4 Dec 2021 22:03:30 +0000

On Sat, Dec 04, 2021 at 10:55:09PM +0100, Lars Ingebrigtsen wrote:
> Alan Third <[email-masked]> writes:
> 
> > I don't believe other macOS applications let you make arbitrary
> > windows "invisible" like Emacs does. Minimising windows and "hiding"
> > the application work exactly like other macOS apps I've tried.
> 
> Ah, right.  
> 
> > We can't resign the main window, afaik. I suppose we could just delete
> > the windows completely when we make them invisible instead of just,
> > y'know, making them invisible.
> 
> I think that'd be even more unexpected.

It may not be as unexpected as you think. macOS windows are made up of
multiple components and when we change between various states, like
switching to fullscreen, we destroy the old NSWindow, create a new one
and then apply the old NSView to it. Maybe not quite in that order. :D

It may be possible to just remove the NSWindow when we make a frame
invisible and hang onto the NSView. It might not be practical, and I'm
not sure if it will really make any difference. I suspect David wanted
to make the frame invisible as a work-around for the bug we fixed
recently where when the last frame was closed the menus and dock icon
were visible but failed to respond.
-- 
Alan Third