unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kai Ma <justksqsf@gmail.com>
To: 61525@debbugs.gnu.org
Subject: bug#61525: 29.0.60; delete-frame will raise frames in another virtual desktop
Date: Wed, 15 Feb 2023 13:26:32 +0900	[thread overview]
Message-ID: <m2ttznlfk7.fsf@gmail.com> (raw)


On MacOS, delete-frame can raise a frame in another virtual desktop,
which will cause switching between desktops.  This is annoying,
especially for emacsclient users.

To quote frame.c:

#ifdef NS_IMPL_COCOA
      else
	/* Under NS, there is no system mechanism for choosing a new
	   window to get focus -- it is left to application code.
	   So the portion of THIS application interfacing with NS
	   needs to know about it.  We call Fraise_frame, but the
	   purpose is really to transfer focus.  */
	Fraise_frame (frame1);
#endif

However, this has an undesired side effect: the desktop will be
switched.

Steps to reproduce:

1. Run emacs.
2. C-x 5 2, and move the new frame to another desktop.
3. C-x 5 0.  Now you see the desktop is switched.

This is a known issue for some time [1] and there is a patch that simply
disables raise_frame [2].  I'm not sure whether this patch is entirely
correct (and I think not).  But I do think the behavior should be
improved; at least the undesired desktop switching should be avoided.

Best regards,
Kai

[1] https://xenodium.com/no-emacs-frame-refocus-on-macos/
[2] https://github.com/d12frosted/homebrew-emacs-plus/blob/master/patches/emacs-28/no-frame-refocus-cocoa.patch





             reply	other threads:[~2023-02-15  4:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15  4:26 Kai Ma [this message]
2023-02-15 10:54 ` bug#61525: 29.0.60; delete-frame will raise frames in another virtual desktop Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-15 15:41   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-15 15:49     ` Kai Ma
2023-02-15 17:08     ` Eli Zaretskii
2023-02-15 23:48       ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-16  8:10         ` Eli Zaretskii
2023-02-16  8:31           ` Kai Ma
2023-02-16 22:40           ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-17  7:53             ` Eli Zaretskii
2023-08-18 13:20         ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-18 13:28           ` Kai Ma
2023-08-19  3:26           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-19  8:28             ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-26  8:06               ` Eli Zaretskii
2023-02-16  1:36       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-16 21:03         ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ttznlfk7.fsf@gmail.com \
    --to=justksqsf@gmail.com \
    --cc=61525@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).