From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61525: 29.0.60; delete-frame will raise frames in another virtual desktop Date: Wed, 15 Feb 2023 19:08:19 +0200 Message-ID: <835yc2c0vw.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25478"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61525@debbugs.gnu.org, justksqsf@gmail.com To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 15 18:09:12 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 1pSLHM-0006Un-Gk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Feb 2023 18:09:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSLHF-0006ID-2F; Wed, 15 Feb 2023 12:09:05 -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 1pSLHD-0006EZ-0I for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 12:09:03 -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 1pSLHC-0005Au-Nq for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 12:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSLHC-0002DK-8u for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2023 12:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2023 17:09: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.16764809278484 (code B ref 61525); Wed, 15 Feb 2023 17:09:02 +0000 Original-Received: (at 61525) by debbugs.gnu.org; 15 Feb 2023 17:08:47 +0000 Original-Received: from localhost ([127.0.0.1]:33815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSLGw-0002Cm-JL for submit@debbugs.gnu.org; Wed, 15 Feb 2023 12:08:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSLGt-0002CU-SR for 61525@debbugs.gnu.org; Wed, 15 Feb 2023 12:08:45 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSLGo-0004HW-FP; Wed, 15 Feb 2023 12:08:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=KfcN7WdTddVme6ZRY/7e6L8kdcS6S9Q7fsxnD4pmQ4w=; b=SyQ0y04K1P6lUTXsJqzH sWDIrfhGodQcSChl8VSpVbhvBeBwoArR7BXKWCIdjSlmRQfxPe+QS3zR7/e84PB74KDBsy37qE3+W y4O2GeGfBxMkAs+9OwP+7jLWIG3xSUFGtRNtfhlkNSwQgkg9i6mZgReL69lgzuI/ZQJ60CL93h07b kzaiPiIkOBPacZFz6HQ043D2JhIvYrNepz+O86UAsa8S3R9l4uR5Gm5oIObJEN6qJrQjQfl65il/m hNXfkbn3KkEAcHhRzwkqMDWNUT/T14+zE/MIJq65qqY+134XDWdfHdbBHeT8FqpDQb//dk+6I0Tlk 23XOAWr/KxpTgQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSLGn-0005C1-NJ; Wed, 15 Feb 2023 12:08:38 -0500 In-Reply-To: (bug-gnu-emacs@gnu.org) 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:255744 Archived-At: > Cc: justksqsf@gmail.com > Date: Wed, 15 Feb 2023 16:41:41 +0100 > From: Daniel Martín via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Daniel Martín via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" writes: > > > > > 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. > > The attached patch avoids the unwanted side effects of raise-frame by > making the other frame the key window, instead. Could you give it a > try? Thanks. > +void ns_make_frame_key_window (struct frame *f) > +{ > + [[FRAME_NS_VIEW (f) window] makeKeyWindow]; > +} Is this new call guaranteed to exist and work well on all the supported OS versions where we have the NS build? I wouldn't want to fix this on some systems and break it on others at the same time. Alternatively, can we come up with a change that does both what the old code did and this addition? That old code did work at some point, I presume?