From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Beshara Newsgroups: gmane.emacs.bugs Subject: bug#48865: [PATCH] Allow =?UTF-8?Q?=E2=80=98ns-hide-emacs=E2=80=99?= to bring only the selected frame forward Date: Sun, 06 Jun 2021 15:23:31 +1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5868"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 To: 48865@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 06 10:43:49 2021 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 1lpoNp-0001Hx-3f for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 10:43:49 +0200 Original-Received: from localhost ([::1]:38544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpoNo-0001Va-3F for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 04:43:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpoN6-000075-Hl for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 04:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpoN5-0006xY-8u for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 04:43:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lpoN5-0002TS-74 for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 04:43:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Beshara Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Jun 2021 08:43:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48865 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16229689449413 (code B ref -1); Sun, 06 Jun 2021 08:43:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jun 2021 08:42:24 +0000 Original-Received: from localhost ([127.0.0.1]:50587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpoMR-0002Rf-Id for submit@debbugs.gnu.org; Sun, 06 Jun 2021 04:42:23 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lplG7-0005vK-Hl for submit@debbugs.gnu.org; Sun, 06 Jun 2021 01:23:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lplG7-00030W-Au for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 01:23:39 -0400 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:46577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lplG5-00050l-C0 for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 01:23:39 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id AA4C51B22 for ; Sun, 6 Jun 2021 01:23:35 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 06 Jun 2021 01:23:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mfa.pw; h=from :to:subject:date:message-id:mime-version:content-type; s=fm2; bh=+dLFTLwDWMvD9+siA76Rq9FjAfOHeHuvUgpUn91KSWk=; b=LvSGebYXlpEF HkNkFyLrkpVOONejHX1MtwofvXpfSZa9QvOgvdWECPWIEklbnyRrNuBd00henbId YW/FHvBZf4y08YMf8Cl9Cpd+Xu78V5pInjqUwhm7bTshyqu7Fb4hnLFO/C3JTZIy 4LO5kesKpNHwds5KLe6G+JGiwtCf9ww4b4wGg1eegKXNei52F4DxVGqqKlwbiAFt CCvLJO3lB/bVbF5KayMmTIJaq5gtIeodXO/eXKFZ26loeBGM2+iOg19/8NSJgTb3 htdj9hEDPkCTXYqb9s2NMoHXzE26c04cvjvhUkOwTMeeoJAV8B+1tIJWR7TYueZA m7D4rlSUBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=+dLFTLwDWMvD9+siA76Rq9FjAfOHe HuvUgpUn91KSWk=; b=IqHFY5bbNwCGEBq4lBZpNgP6EidJNi7HObaIlB1T9O0F4 SRVNiI7cOmP0+hPbfDnEC3UGK9YA5zrW63IbQ8D7T1f6+cnNSfAJfjK6Qal+3ieU cp7vddi8MAa4cdrDjS5s9RVdXxXZBr6XBr19NiSe6MridtTCwp3rp0cTRACBXCdD gjtHUJ0cCVT7puX+MfXZe5g5XcQvYQ75QkduiTaacfwwGUcvl8PaKbhIQuIFhz42 KePVbZ8K0VQIz+sOnlpml0FTNSnpNtuOJM0fQxAXk2XcFZ1cY0Q2Hww/rfsxKFnk hcB0eFrsWY6HPoCEPOV293/yGIqsyreoIoQkuf/PQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtgedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlfedtmdenucfjughrpegfhf fvufffkfggtgesghdtreertderjeenucfhrhhomhepofgrthhtuceuvghshhgrrhgruceo mhesmhhfrgdrphifqeenucggtffrrghtthgvrhhnpeffkefhfefhjefhkeeludegvefgue fhuefgteelfeekfeeguefhheekudfhtedujeenucffohhmrghinhepmhhfrgdrphifnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhesmhhfrg drphif X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 6 Jun 2021 01:23:34 -0400 (EDT) Received-SPF: pass client-ip=64.147.123.19; envelope-from=m@mfa.pw; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 06 Jun 2021 04:42:21 -0400 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" Xref: news.gmane.io gmane.emacs.bugs:208095 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi there, I have attached a patch which adds a new capability to the=20 =E2=80=98ns-hide-emacs=E2=80=99 function in the NS port. Specifically, it = causes=20 the =E2=80=98ns-hide-emacs=E2=80=99 function to respond to being called wit= h the=20 argument 'activate-front in a similar way to how it responds when=20 called with 'activate. The difference is, instead of layering=20 every Emacs frame in front of every other application=E2=80=99s windows,=20 it only brings the selected frame forward. I have uploaded a=20 small video of the new functionality in action here:=20 https://mfa.pw/activate-front.mp4 Please let me know if any modifications would need to be made to this patch before it could be accepted. Thanks for your time, Matt --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=activate-front.patch Content-Transfer-Encoding: quoted-printable Content-Description: activate-front.patch From=20e595e37fa7ea503020e8acfe82324cff7751bf3d Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Sun, 6 Jun 2021 13:06:47 +1000 Subject: [PATCH] =3D?UTF-8?q?Allow=3D20=3DE2=3D80=3D98ns-hide-emacs=3DE2=3D= 80=3D99=3D20to=3D20?=3D =3D?UTF-8?q?bring=3D20only=3D20the=3D20selected=3D20frame=3D20forward?=3D MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit =2D-- src/nsfns.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/nsfns.m b/src/nsfns.m index d14f7b51ea..f6ad1f7b9d 100644 =2D-- a/src/nsfns.m +++ b/src/nsfns.m @@ -1953,8 +1953,11 @@ Frames are listed from topmost (first) to bottommost= (last). */) doc: /* If ON is non-nil, the entire Emacs application is hidden. Otherwise if Emacs is hidden, it is unhidden. If ON is equal to `activate', Emacs is unhidden and becomes =2Dthe active application. */) =2D (Lisp_Object on) +the active application. +If ON is equal to `activate-front', Emacs is unhidden and +becomes the active application, but only the selected frame +is layered in front of the windows of other applications. */) + (Lisp_Object on) { check_window_system (NULL); if (EQ (on, intern ("activate"))) @@ -1962,6 +1965,12 @@ Frames are listed from topmost (first) to bottommost= (last). */) [NSApp unhide: NSApp]; [NSApp activateIgnoringOtherApps: YES]; } + else if (EQ (on, intern ("activate-front"))) + { + [NSApp unhide: NSApp]; + [[NSRunningApplication currentApplication] + activateWithOptions: NSApplicationActivateIgnoringOtherApps]; + } else if (NILP (on)) [NSApp unhide: NSApp]; else =2D-=20 2.24.3 (Apple Git-128) --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iH8EARYKACcWIQQAspJWbe9M+a9rgYVIIu8JuyI3CgUCYLxb0wkcbUBtZmEucHcA CgkQSCLvCbsiNwovFwD/eLHYGtXkoFqog05ZlBwR/ajXGq6L+HHL7o3vWX/5aXQB AMFow9ID6jUBHTuXFSIjGbEGCC0NnFwRtfy35rHuuxkK =GfP2 -----END PGP SIGNATURE----- --==-=-=--