On Mon, Aug 16, 2021 at 06:13:03PM +0100, Alan Third wrote: > On Mon, Aug 16, 2021 at 02:57:58PM +0200, Lars Ingebrigtsen wrote: > > random832@fastmail.com writes: > > > > > If I have Emacs (OSX App) started in daemon mode, and then create a > > > GUI frame, e.g. emacsclient -c, an instance of Emacs.app starts, > > > which then does not go away when the frame is closed with C-x C-c. > > > Most menu items, even ones such as "New Frame (C-x 5 2)" that seem > > > like they should make sense without a frame, are unresponsive. > > > > (I'm going through old bug reports that unfortunately weren't > > resolved at the time.) > > > > Is this problem still present in recent Emacs versions? > > As far as I'm aware it is. The attached patch "fixes" this by hiding the app icon in the dock and removing the menus. It's still possible to create a new frame using emacsclient. There's still a bug when a terminal frame is open and the last GUI frame is closed. I've put the code in ns_delete_terminal, which may not be the best place. Perhaps it should go in the normal frame closing function and check whether there are any remaining open frames. The alternative is to occasionally run the NS run loop even when there are no NS frames open. I don't know how we could do that but it would allow us to leave the menu and dock icon available and operative even without any GUI frames open. -- Alan Third