From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61525: 29.0.60; delete-frame will raise frames in another virtual desktop Date: Sat, 19 Aug 2023 10:28:48 +0200 Message-ID: References: <835yc2c0vw.fsf@gnu.org> <87350fg1a6.fsf@yahoo.com> Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12515"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61525@debbugs.gnu.org, Eli Zaretskii , justksqsf@gmail.com To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 19 10:30:06 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qXHLS-000358-BM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Aug 2023 10:30:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXHLP-0006qF-2n; Sat, 19 Aug 2023 04:30:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXHLN-0006pY-9B for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 04:30:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qXHLN-0006Pq-0p for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 04:30:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXHLN-0004hj-SD for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 04:30:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Aug 2023 08:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61525 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61525-submit@debbugs.gnu.org id=B61525.169243374417978 (code B ref 61525); Sat, 19 Aug 2023 08:30:01 +0000 Original-Received: (at 61525) by debbugs.gnu.org; 19 Aug 2023 08:29:04 +0000 Original-Received: from localhost ([127.0.0.1]:49354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXHKS-0004ft-0D for submit@debbugs.gnu.org; Sat, 19 Aug 2023 04:29:04 -0400 Original-Received: from sonic306-19.consmr.mail.ir2.yahoo.com ([77.238.176.205]:38958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXHKP-0004fG-Nr for 61525@debbugs.gnu.org; Sat, 19 Aug 2023 04:29:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1692433734; bh=cwffzKeys8rlxXvHD6QyN9s0wtd3PEhjSPeyxsBp0dQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=XDbFSvm9bbgIMpkXjNxtw4sYRsWJgWWU3pSIrNOBWf73PJqHZ2CRwb8PTk9PdEvlXebLeo8STKxdTvQT2bddcertwuUKHhbitS1NMPLdFiRjp7j6Gs5xnqIHTSivJmJOURgResQtuliyuS/eklEMFfwjXKtUXSIBvCp2f3zDNG2ijTYTP5p6d7X2SZmuKxR29Gep9WsBMMqpUvtzO2Z2XcZpEAOXSyxRK8SxILHTRCObZq6ULAD5nTBTfntV0rpOrbKnE/dcYuedK4OwfHOXIAog5M10p5Lhw8bBAxbQ3umz688b9EP282CTFftQWpTYTz2GGyvA4uWP7/vr90auMQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1692433734; bh=njEhDH+yy3gyjtj117GsUWeI2rgBXHgsqH65ArmhJ+O=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=t+JHj1DeL5vlm8x0OMBQOeAXdBA6KFAE5oSTP6MBp6C8MgJVA/ltX6oKz9sPiwed/PNnfK/HwKb3UmqABjzPTOzBrKqpK9dw2InjTuUqgaMebmTX7wCUdmC+QW220P+tEv4jcuqISn6IyM31X1G0pxB1+Th5l7NvVQFxwDIbOj0V4dKIuJvlqazhgqWHihgkw5pUmjrxZbtFAlDUXdYTxyC5d/D0WmdctJca2DV9rHe+urexxjr9SxWAip8JJtm5toci4rPKosJpCUyFP6G5wmxw2ykrRdo3F7vj996jV592rtbf6sh3K5no4dTvc6o7IdEGHRpKHp7gIN2mALHf7Q== X-YMail-OSG: PYvpIEoVM1nAJn2l5J3SFdaRDAauPldd5LdANMIBf1ZbogEjKwWyjV6CfxPDN5. weh.UrM3P4hXNyNVBbT3ejTPKstcRfDl_r8NzYQixNrCT_YFWD3cCUAEKztd.wYVIU5jBS0EJLc1 GBTcN0YAe54kNJNXzDrmU64IsB0MWOjqwyfbu9fRWNoOKVvz.kf.8JTfls7DTMAZaAXdNEcxloBL h7ZtnTyXKO0FAgkuNzs3UpLW2M5pYK56Yxx9bsqFAzuLLpWdrjQbp72G4_eC8INxwCoNGt_m4_Aq zCr8uXyPY741aesTmW7d4ayhrC4uEvXebCHtCFTTmUMUedyvOWFmLlnMPjgLVrbIFqdXAfRCYZb7 .NbpAA4S8hHF5XUIYKIHexNrjWTlFYL.c5MXNKVTyUQsQsnqQVqMLQduogcA8GjqRE9AJAY7xB04 HOxLRe4oqk3BtWk6hKPCM4sqIF3Lk1YrZr_yx0YdGzxXUxdHeqKyJPIxJr7YSkj5RQcHZeS.PRd5 KCCEtTCyTWPMh_vHKyVpKb9mF315Mka4N4oZOev4nSZAzvFHUxw28yK6dWnej0NGqm3BBq.RZgUn 2naSTnCZaW1been207k.9ADl6geF7KDwyIfUQb39Igxcvc1FWHH1WE167e0eVf3XReVMI9qcwb7y psz3vCdXYsymaPceqWSpujum9RDYJHU_dFUavCso.77onEVb7HbrOz7Gcodw0MD0N4jFWTRNRlxl VVzRZGoY.PjrbtmLokBkFuSoCyAcEzs9cpccaihvJwxzHxsKI6htodPZSgfTJafW.0W_MOpUPcK1 A3ms6MjqruLuDRx02VMELM1L_pQIrpwry2VaZRSuUB X-Sonic-MF: X-Sonic-ID: 5e19f312-0141-4021-ae8b-754fb4fa1b50 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Sat, 19 Aug 2023 08:28:54 +0000 Original-Received: by hermes--production-ir2-5cc57b9c45-4sdwq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 85717370380f088ffac272e0e9a79061; Sat, 19 Aug 2023 08:28:49 +0000 (UTC) In-Reply-To: <87350fg1a6.fsf@yahoo.com> (Po Lu's message of "Sat, 19 Aug 2023 11:26:57 +0800") X-Mailer: WebService/1.1.21732 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267828 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Po Lu writes: > Daniel Mart=C3=ADn 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-NS-Do-not-raise-a-different-frame-when-closing-a-fra.patch >From 3f8d0ee00ab9392d27831d64ef154c92b2b60608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= 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 --=-=-=--