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: Wed, 15 Feb 2023 11:54:17 +0100 Message-ID: References: Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10935"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cc: 61525@debbugs.gnu.org To: Kai Ma Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 11:55:33 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 1pSFRl-0002cl-2Q for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 11:55:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSFRK-00050u-G9; Wed, 15 Feb 2023 05:55:06 -0500 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 1pSFRH-000500-JI for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 05:55:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSFRG-000869-Vr for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 05:55:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSFRG-0007tl-NA for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 05:55:02 -0500 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: Wed, 15 Feb 2023 10:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61525 X-GNU-PR-Package: emacs Original-Received: via spool by 61525-submit@debbugs.gnu.org id=B61525.167645847230296 (code B ref 61525); Wed, 15 Feb 2023 10:55:02 +0000 Original-Received: (at 61525) by debbugs.gnu.org; 15 Feb 2023 10:54:32 +0000 Original-Received: from localhost ([127.0.0.1]:57939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSFQm-0007sa-Bw for submit@debbugs.gnu.org; Wed, 15 Feb 2023 05:54:32 -0500 Original-Received: from sonic311-30.consmr.mail.ir2.yahoo.com ([77.238.176.162]:39320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSFQj-0007sJ-UZ for 61525@debbugs.gnu.org; Wed, 15 Feb 2023 05:54:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1676458463; bh=dKSLSiWsAtUrd/XgnuyOuZIJxaWigqU5RDgV5kSTcR8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=hpnNmOgDM+Thr2X12UIvRC0bbGqimwChucRic67gcg1Tu2/qGno+eVHAqUPtxbT0hCC+2l6KQuWXIsPqu78dasoraF2S25d/MyuoaPnk93BUtkE0xCioedT70gEc7e0h3COAbQqCloiAzrC4LMQp856bi1whgvzvlvoHKvjCCXN9NNXwfNxf2HNQ5yuR1Fo9S/vfwFdUjq7k/1zCGrlY8nyeg2ZwEwG29gMx9SVgfH0EQcrDmt5T+OsJjBoNVhVMQfCRHxVWVSlbeUGSFkRLj8mutdQloQyQ1grYoPftXZVT+6woz/EBIUffUCox+4b3fToFZG6MNCEys+9LlpEU+A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676458463; bh=m7wN7Afwme+LalQ/jRzUJWKSHTwR61ZTTlrf7/KXS+E=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=VyKDkpfAtHUuIjGNWjofD/iDQVpCMfY0meg1EE00i47jnVTtRonsoIJapQqR0iekpBng0SORhIbGTKbODMPP/y2ojfQSB5ySdkgGyavSJKFBMokgg1dLRk6kr/tIEWK4NZFwWWENwRWWUg6wELK1EF5pVqMLxSpaYbuGHNuByugkF66kUo6MLwh5zSgwZCFqou/5C0Vl/ylVhe4QF/WtcnLUj3sU7Vrc0ghZOtC3vE38zH9uwp8B7gievQ1FdnbM/BLOK31y/P5WFCclffkzeWJuHnFtDkc6n0LIMQs7J7YFZkPKZ9QSkY9FgGvahiKe4ainQY+DEgteQ8YkYJPiZg== X-YMail-OSG: TqmMrVkVM1noRD_062cJ3IAeI5J5JrjlmKNDsUts0EjXm4HlxOgPHOyZZecroKL SwtM0ns8yzGmfL6pAozyHIRdGsGs6Pcoxb13mFiEv5rLKd.R6w.IFWxXDLv6G4zk58yO6hLeBJIX VuXL2Bfl3muv7gRasgtR4s1EgbNhSKVzn7scveCyPeogUhxybLVufzy7qXfMaRiKo4Qe1pqBLu.o AGIR89jTyUZVi6loTNd9zDIU.JN.imzgfJrq6jnNSuYVyXfwCpiKTSsRIup5UdoBTmsacPVuQxBc x7QZxga13OG8hljrmHdLrFgwYWcXh8BETvHgT.poEk53xuPJkr_gO9l5oHIpSv88rn.QXGOiC19y TWHGzyF.lOdkvk99r8gd_3ZglSXey0Y_8MdqBIQe3i8AriTmvnJP5gvli6aOZIW9IAX7GYKq0ZDL vKmXnuKEr392eIR8WSDQ_xpbbSmv2ufs3i0ZpN.Ip4IpjXSI437AP6UPH9TDi7UepGzs3oMVmcjE qfd5OgqiDtHqEQClq8i.9fuCW7t_LonL6x4LmpuonaFf1_u8nX_IzLyiaKJE3I1OGJB0AKrd2RBz SgoEmHvf0Dr08dt1ap2OxOpQO94maoIX6IFMu1uz0jSgGx8pMZSK6nEVttIrXU7QntvRryYamOk6 JPGEJu.biA3wE8ru_JanBybdjOgt_8CG4XD687K4nsaR9pilMRNEpZwnlaIqHOm8pHdjRrYMKQct 3z..WedT6QTDlP6RJnw2hpd.jl0yxwEz5GKiaZXKZr2o1zZdNgofJNyWLIkA70K02_gifOUqOu7k NeHzy_ALs8AXtrO7xbDF8PcB607BBjjo8DIcG1M9M8 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ir2.yahoo.com with HTTP; Wed, 15 Feb 2023 10:54:23 +0000 Original-Received: by hermes--production-ir2-65c64dfd66-mp9nb (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 141e552a3256eade7703038d5e46ba23; Wed, 15 Feb 2023 10:54:19 +0000 (UTC) In-Reply-To: (Kai Ma's message of "Wed, 15 Feb 2023 13:26:32 +0900") X-Mailer: WebService/1.1.21183 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:255677 Archived-At: Kai Ma writes: > 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. > One downside of removing raise_frame is that, after you press C-x 5 0, you cannot start typing right away without first focusing on another Emacs frame manually. People would consider this a regression from previous versions and something that doesn't happen on GNU/Linux. A possibly better approach could be: Once the "other" frame to select is chosen by the code that is just above in frame.c, call some Obj-C code that extracts the EmacsView and makes it the first responder: EmacsView *view = FRAME_NS_VIEW (frame1); [self makeFirstResponder:view]; I haven't tested this, but perhaps this makes the other frame receive focus without switching desktops in a multi-desktop configuration.