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#48864: [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:18:45 +1000 Message-ID: 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="2272"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 To: 48864@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:13 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 1lpoNE-0000Mq-JL for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 10:43:13 +0200 Original-Received: from localhost ([::1]:36602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpoND-00007i-Ky for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Jun 2021 04:43:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpoN6-000074-HQ for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 04:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpoN4-0006xW-Nb 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 1lpoN4-0002TE-JL for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 04:43:02 -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:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48864 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.16229689439406 (code B ref -1); Sun, 06 Jun 2021 08:43:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jun 2021 08:42:23 +0000 Original-Received: from localhost ([127.0.0.1]:50585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpoMQ-0002Rc-Hs for submit@debbugs.gnu.org; Sun, 06 Jun 2021 04:42:23 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lplBv-0005p1-Ep for submit@debbugs.gnu.org; Sun, 06 Jun 2021 01:19:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lplBv-0002Vu-8h for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 01:19:19 -0400 Original-Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]:53487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lplBt-0001BE-9W for bug-gnu-emacs@gnu.org; Sun, 06 Jun 2021 01:19:19 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 185B81B90 for ; Sun, 6 Jun 2021 01:19:14 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sun, 06 Jun 2021 01:19:14 -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=LiXbB5gluQRAmnFxJbd+cLTso1lCAMYmPydmj6TrTZg=; b=bbJDaYT84+47 hi+dT0twOZWbQReEYFH0b6DpIGXXZOO/0DD0zp0MvTk/TS5wBMTDMh7CPWsYduaQ JSNHSWzWtxbNdFnUUChekO0TORzTxVTX1qpRcqPLpSHlSYj6aIMA33uJOQSZIhAy hhJke60SlCVME7dn5LxTvrwdOqWKmaw95N57x9GDwZ2a4/N4SJ8FOMrWdUfiky1s ObD8zic0RHkY/oAn9k3eW+myq0nYqMd2tvC5G/606FXEWd5c0NSln4FRT/iL05pc STm65Oy0eL+oLif4iBNC0j7xCjZez/tmJHV+bjQKh6QhFxDXNjqu0LrPPRotMpHX m0kbLKxe5g== 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=LiXbB5gluQRAmnFxJbd+cLTso1lCA MYmPydmj6TrTZg=; b=DZVvctWZsaiB9qFkw5LzeJtjYxTR+hprKM1cHqGMF7M2U I9S6sF7GcSN/xMMiafTvbXWkdMdAY8OrId7ll/yXKaStReie7Vl5hfrLyufE4GRX DC8uF1vKg558Ed7gFU9sklr2t22gDcW87lyPeyB5BlTP1u+lXLZnzH+8Z0pAyazN G//wIlJYXGkyHeqr+CfvMrEHmXnQw0sNwAxrdln13jEXedfIjOOaKyuuDzfkZxcp 655y2qK8Fj6hxE52GfmPyISYUaibSbk0rqQZH41AwXFj62HeFcVkWCvX09bOUorc gHNZ8EASE/iZAUWhizwj+4Hc971dQrOf7J7K8IO0Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtgedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlfedtmdenogfthfevqddque grugeuohhunhgurghrhiffvggtlhgrrhgrthhiohhnucdlhedtmdenogeurgguqdfouhhl thhiphgrrhhtofhigigvugculdehuddmnecujfgurhepfgfhvffufffkgggtsehmtderre dtreejnecuhfhrohhmpeforghtthcuuegvshhhrghrrgcuoehmsehmfhgrrdhpfieqnecu ggftrfgrthhtvghrnhepvedvjedvleetieeggfegteelieduieeiueevheegueduleduje ehtefgteduveefnecuffhomhgrihhnpehmfhgrrdhpfienucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsehmfhgrrdhpfi X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 6 Jun 2021 01:19:12 -0400 (EDT) Received-SPF: pass client-ip=64.147.123.27; envelope-from=m@mfa.pw; helo=wnew2-smtp.messagingengine.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, MIME_NO_TEXT=1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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:208094 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 - --=-=-= 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=20 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) - --=-=-=-- -----BEGIN PGP SIGNATURE----- iH8EARYKACcWIQQAspJWbe9M+a9rgYVIIu8JuyI3CgUCYLxazAkcbUBtZmEucHcA CgkQSCLvCbsiNwoqRwEA+Vfc7X4ZrKGKiiNhBuMHXNH4B2kzvfbBnuidzCy9TE4A /A++laL4yo7+yVsS2O+MOzDCFyevIYZsM9EYn0H15bkA =5uBi -----END PGP SIGNATURE-----