From: "Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: 61525@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>, justksqsf@gmail.com
Subject: bug#61525: 29.0.60; delete-frame will raise frames in another virtual desktop
Date: Sat, 19 Aug 2023 10:28:48 +0200 [thread overview]
Message-ID: <m1edjzzb9b.fsf@yahoo.es> (raw)
In-Reply-To: <87350fg1a6.fsf@yahoo.com> (Po Lu's message of "Sat, 19 Aug 2023 11:26:57 +0800")
[-- Attachment #1: Type: text/plain, Size: 573 bytes --]
Po Lu <luangruo@yahoo.com> writes:
> Daniel Martín <mardani29@yahoo.es> writes:
>
>> * src/frame.h: Declare an NS-only function to make a frame the key
>> window.
>> * src/nsfns.m (ns_make_frame_key_window): Implement it.
>> * src/frame.c (delete_frame): Call ns_make_frame_key_window instead of
>> Fraise_frame. (Bug#61525)
>
> This commit message extends into column 70. Please fill it to 64
> columns, or else the ChangeLog entries generated will be incorrectly
> formatted.
I've attached a new patch with the commit message wrapped at 64 columns.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-NS-Do-not-raise-a-different-frame-when-closing-a-fra.patch --]
[-- Type: text/x-patch, Size: 2622 bytes --]
From 3f8d0ee00ab9392d27831d64ef154c92b2b60608 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= <mardani29@yahoo.es>
Date: Fri, 18 Aug 2023 15:03:21 +0200
Subject: [PATCH] [NS] Do not raise a different frame when closing a frame
* src/frame.h: Declare an NS-only function to make a frame the
key window.
* src/nsfns.m (ns_make_frame_key_window): Implement it.
* src/frame.c (delete_frame): Call ns_make_frame_key_window
instead of Fraise_frame. (Bug#61525)
---
src/frame.c | 15 +++++++++------
src/frame.h | 4 ++++
src/nsfns.m | 6 ++++++
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/src/frame.c b/src/frame.c
index da00cbf4bce..addeb013b4a 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2212,12 +2212,15 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
}
#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);
+ {
+ /* 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 make the frame we switch to the key window. */
+ struct frame *f1 = XFRAME (frame1);
+ if (FRAME_NS_P (f1))
+ ns_make_frame_key_window (f1);
+ }
#endif
do_switch_frame (frame1, 0, 1, Qnil);
diff --git a/src/frame.h b/src/frame.h
index c85df378da6..f4726f1c0e5 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1521,6 +1521,10 @@ window_system_available (struct frame *f)
extern void frame_size_history_plain (struct frame *, Lisp_Object);
extern void frame_size_history_extra (struct frame *, Lisp_Object,
int, int, int, int, int, int);
+#ifdef NS_IMPL_COCOA
+/* Implemented in nsfns.m. */
+extern void ns_make_frame_key_window (struct frame *);
+#endif
extern Lisp_Object Vframe_list;
/* Value is a pointer to the selected frame. If the selected frame
diff --git a/src/nsfns.m b/src/nsfns.m
index b846b490ff7..a79892f73b6 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -685,6 +685,12 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
SET_FRAME_GARBAGED (f);
}
+void
+ns_make_frame_key_window (struct frame *f)
+{
+ [[FRAME_NS_VIEW (f) window] makeKeyWindow];
+}
+
/* tabbar support */
static void
ns_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
--
2.40.1
next prev parent reply other threads:[~2023-08-19 8:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 4:26 bug#61525: 29.0.60; delete-frame will raise frames in another virtual desktop Kai Ma
2023-02-15 10:54 ` 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 [this message]
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=m1edjzzb9b.fsf@yahoo.es \
--to=bug-gnu-emacs@gnu.org \
--cc=61525@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=justksqsf@gmail.com \
--cc=luangruo@yahoo.com \
--cc=mardani29@yahoo.es \
/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).