GNU bug report logs - #21357
24.5; Daemon leaves Mac OSX App open after closing GUI frame

Previous Next

Package: emacs;

Reported by: random832 <at> fastmail.com

Date: Wed, 26 Aug 2015 23:39:02 UTC

Severity: normal

Merged with 14619, 23586

Found in versions 24.3, 24.5, 25.0.94

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21357 in the body.
You can then email your comments to 21357 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Wed, 26 Aug 2015 23:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to random832 <at> fastmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Aug 2015 23:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: random832 <at> fastmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; Daemon leaves Mac OSX App open after closing GUI frame
Date: Wed, 26 Aug 2015 19:35:50 -0400
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.

The app is also unable to respond to s-q, though it does respond to the
"Quit Emacs (Command-Q)" item in the App menu, which C-h k shows
as sending <ns-power-off> rather than a <menu-bar> sequence.

I'm not sure what behavior should be expected here. In order of my
personal preference:

1. Keep the app open, and most menu commands should open a new
   frame.

2. Somehow (is this possible?) close the app instance without shutting
   down the daemon process, when there are no frames.

3. Somehow create a separate app instance for each emacsclient -c
   process.

In GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)
 of 2015-04-10 on builder10-9.porkrind.org
Windowing system distributor `Apple', version 10.3.1344
Configured using:
 `configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Starting Emacs daemon.
When done with this frame, type C-x 5 0

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils server time-date tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
cocoa ns multi-tty emacs)

Memory information:
((conses 16 72471 4238)
 (symbols 48 17293 0)
 (miscs 40 43 140)
 (strings 32 10183 4263)
 (string-bytes 1 271546)
 (vectors 16 9219)
 (vector-slots 8 376271 16268)
 (floats 8 57 68)
 (intervals 56 173 0)
 (buffers 960 12))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Tue, 03 Nov 2015 15:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 21357 <at> debbugs.gnu.org (full text, mbox):

From: Random832 <random832 <at> fastmail.com>
To: 21357 <at> debbugs.gnu.org
Subject: Bug #21357 is a duplicate of #14619
Date: Tue, 03 Nov 2015 10:39:46 -0500
Sorry about this, I had not found the original bug when I searched
before reporting the bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Tue, 03 Nov 2015 16:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 21357 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Random832 <random832 <at> fastmail.com>
Cc: 21357 <at> debbugs.gnu.org
Subject: Re: bug#21357: Bug #21357 is a duplicate of #14619
Date: Tue, 03 Nov 2015 18:04:49 +0200
> From: Random832 <random832 <at> fastmail.com>
> Date: Tue, 03 Nov 2015 10:39:46 -0500
> 
> 
> Sorry about this, I had not found the original bug when I searched
> before reporting the bug.

No need to apologize, but please do merge them.

Thanks.




Merged 14619 21357. Request was from Random832 <random832 <at> fastmail.com> to control <at> debbugs.gnu.org. (Tue, 03 Nov 2015 17:06:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Mon, 16 Aug 2021 12:59:01 GMT) Full text and rfc822 format available.

Message #16 received at 21357 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: random832 <at> fastmail.com
Cc: 21357 <at> debbugs.gnu.org
Subject: Re: bug#21357: 24.5; Daemon leaves Mac OSX App open after closing
 GUI frame
Date: Mon, 16 Aug 2021 14:57:58 +0200
random832 <at> 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?

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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Aug 2021 12:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Mon, 16 Aug 2021 17:14:01 GMT) Full text and rfc822 format available.

Message #21 received at 21357 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: random832 <at> fastmail.com, 21357 <at> debbugs.gnu.org
Subject: Re: bug#21357: 24.5; Daemon leaves Mac OSX App open after closing
 GUI frame
Date: Mon, 16 Aug 2021 18:13:03 +0100
On Mon, Aug 16, 2021 at 02:57:58PM +0200, Lars Ingebrigtsen wrote:
> random832 <at> 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.
-- 
Alan Third




Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 18 Aug 2021 13:39:02 GMT) Full text and rfc822 format available.

Merged 14619 21357 23586. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Wed, 25 Aug 2021 19:01:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Wed, 25 Aug 2021 20:20:01 GMT) Full text and rfc822 format available.

Message #28 received at 21357 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, random832 <at> fastmail.com,
 21357 <at> debbugs.gnu.org
Subject: Re: bug#21357: 24.5; Daemon leaves Mac OSX App open after closing
 GUI frame
Date: Wed, 25 Aug 2021 21:18:51 +0100
[Message part 1 (text/plain, inline)]
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 <at> 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
[0001-Disable-the-NS-app-when-no-frames-are-left-bug-14619.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Thu, 26 Aug 2021 14:01:02 GMT) Full text and rfc822 format available.

Message #31 received at 21357 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alan Third <alan <at> idiocy.org>
Cc: random832 <at> fastmail.com, 21357 <at> debbugs.gnu.org
Subject: Re: bug#21357: 24.5; Daemon leaves Mac OSX App open after closing
 GUI frame
Date: Thu, 26 Aug 2021 16:00:12 +0200
Alan Third <alan <at> idiocy.org> writes:

> 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.

I think that makes sense...

> 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.

I would expect there to be nothing in the dock when running an Emacs
daemon (and there's no frames open), but don't really have an opinion on
this.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21357; Package emacs. (Sun, 29 Aug 2021 09:28:01 GMT) Full text and rfc822 format available.

Message #34 received at 21357 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: random832 <at> fastmail.com, 21357 <at> debbugs.gnu.org
Subject: Re: bug#21357: 24.5; Daemon leaves Mac OSX App open after closing
 GUI frame
Date: Sun, 29 Aug 2021 10:27:11 +0100
On Thu, Aug 26, 2021 at 04:00:12PM +0200, Lars Ingebrigtsen wrote:
> Alan Third <alan <at> idiocy.org> writes:
> 
> > 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.
> 
> I think that makes sense...

Since I don't think we're likely to get anyone testing this on the
strength of this bug report, I've pushed it to master and we can wait
and see if anyone has any comments.

> > 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.
> 
> I would expect there to be nothing in the dock when running an Emacs
> daemon (and there's no frames open), but don't really have an opinion on
> this.

I reckon that many Mac users would expect if they run an application
(in the normal way, not daemon mode) and close all the windows the
application menu and dock icon will still work, allowing them to open
new windows and so on. I don't think it's unreasonable for the app to
just quit, though.
-- 
Alan Third




Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Sat, 09 Oct 2021 14:58:02 GMT) Full text and rfc822 format available.

Notification sent to random832 <at> fastmail.com:
bug acknowledged by developer. (Sat, 09 Oct 2021 14:58:02 GMT) Full text and rfc822 format available.

Message #39 received at 21357-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, random832 <at> fastmail.com,
 21357-done <at> debbugs.gnu.org
Subject: Re: bug#21357: 24.5; Daemon leaves Mac OSX App open after closing
 GUI frame
Date: Sat, 9 Oct 2021 15:57:39 +0100
On Sun, Aug 29, 2021 at 10:27:11AM +0100, Alan Third wrote:
> On Thu, Aug 26, 2021 at 04:00:12PM +0200, Lars Ingebrigtsen wrote:
> > Alan Third <alan <at> idiocy.org> writes:
> > 
> > > 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.
> > 
> > I think that makes sense...
> 
> Since I don't think we're likely to get anyone testing this on the
> strength of this bug report, I've pushed it to master and we can wait
> and see if anyone has any comments.

It's been over a month with no complaints, so I'm closing this bug report.
-- 
Alan Third




Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Sat, 09 Oct 2021 14:58:02 GMT) Full text and rfc822 format available.

Notification sent to Ryan <rct <at> thompsonclan.org>:
bug acknowledged by developer. (Sat, 09 Oct 2021 14:58:02 GMT) Full text and rfc822 format available.

Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Sat, 09 Oct 2021 14:58:02 GMT) Full text and rfc822 format available.

Notification sent to Jiegec <jiegec <at> qq.com>:
bug acknowledged by developer. (Sat, 09 Oct 2021 14:58:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Nov 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.