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: Sat, 12 Jun 2021 09:39:13 +1000 Message-ID: References: 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="12150"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 Cc: 48865@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 12 03:38:10 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 1lrsbB-0002zw-8g for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Jun 2021 03:38:10 +0200 Original-Received: from localhost ([::1]:50686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrsbA-0002V4-AU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Jun 2021 21:38:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrsb4-0002Uv-8x for bug-gnu-emacs@gnu.org; Fri, 11 Jun 2021 21:38:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrsb4-0006FA-1J for bug-gnu-emacs@gnu.org; Fri, 11 Jun 2021 21:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lrsb3-0007fQ-QO for bug-gnu-emacs@gnu.org; Fri, 11 Jun 2021 21:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Beshara Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Jun 2021 01:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48865 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 48865-submit@debbugs.gnu.org id=B48865.162346185929440 (code B ref 48865); Sat, 12 Jun 2021 01:38:01 +0000 Original-Received: (at 48865) by debbugs.gnu.org; 12 Jun 2021 01:37:39 +0000 Original-Received: from localhost ([127.0.0.1]:40131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrsag-0007el-AJ for submit@debbugs.gnu.org; Fri, 11 Jun 2021 21:37:39 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:38329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrqkK-0004vm-UD for 48865@debbugs.gnu.org; Fri, 11 Jun 2021 19:39:29 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id E96CD10C9; Fri, 11 Jun 2021 19:39:21 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 11 Jun 2021 19:39:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mfa.pw; h= references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm2; bh=id81XnC/L4QWDKPvGKPFoY03Wi iONDpcN94V9c3XM8c=; b=dXSxVcTeNqPGI3M15nI7gWfonsQjKueVCHfAVJuhff LUMQOXo5Fa924ubrOBKcxOiTzYbrITWJe4mWH10nabOz6CaiOdmVPwF4Vp9Kwwo0 ez5JJI6hWjPCQjpajzHINxrPHGxZ3f02158k1w/KskqiGFy9w+SoUwM2H3P2Qit7 IyJp9RDGiDsh6dQ9Urj/aQE38uRnA5gxi2q5Xw65dwG3/9RyMZVg5jjcB3avEZGC 7dRvcB+7pn5lAm8DomxwcKhf0Ko2uSfXsyflK4nOm2Qjn7ngqERV0QYcnsQZL5lh KK/3KomMHl8X4cKYADbWiCzyh3VGHvsDXJaZwSruwB/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=id81Xn C/L4QWDKPvGKPFoY03WiiONDpcN94V9c3XM8c=; b=l3oDS5E8e6APYam3hSRY6H V4HsjtCBsPh5+bOXdLy0+uM984D8AVuyX1cP8V+EWGO/r9dkC7ffkMhr2zixPyA1 J/n2PayaohZfn50/sKdWs4S+V9/mliC4IGcWyOUojV0fI9iq1S/Kdf6/hQ366Vaq jQeo4zM0ntjmT0tNjLrtPP1c3pXaA+HQp/UPSKD3f7NmMjW2F828M5I0qa44AE25 RrJygW8aHvoWNeBrQya0/SD+8TFb3fLabhrYpvEul4a4NnSO9AeWPpO3qMo1Uook ihxTh4eniE1IiElfJ1hgEs6VRre4cYKoyKpYsSYYC8sA+VSr7jQspzQEs0kmvPJQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeduledgudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdludehmdenucfjughrpehffgfhvffujgffkfggtgesghdtreertder jeenucfhrhhomhepofgrthhtuceuvghshhgrrhgruceomhesmhhfrgdrphifqeenucggtf frrghtthgvrhhnpeffheejheefhfdugeeiieduvefgtdeludehgfdujeehgfeltdeljeeu fefhudeltdenucffohhmrghinhepmhhfrgdrphifnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhesmhhfrgdrphif X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Jun 2021 19:39:19 -0400 (EDT) In-reply-to: X-Mailman-Approved-At: Fri, 11 Jun 2021 21:37:37 -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:208363 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Alan Third writes: Hi Alan, I=E2=80=99ve attached an updated patch. Is the commit message OK? Matt > On Sun, Jun 06, 2021 at 03:23:31PM +1000, Matt Beshara wrote: >> 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 the=20 >> =E2=80=98ns-hide-emacs=E2=80=99 >> function to respond to being called with the argument=20 >> 'activate-front in a >> similar way to how it responds when called with 'activate. The=20 >> difference >> is, instead of layering every Emacs frame in front of every=20 >> other >> application=E2=80=99s windows, it only brings the selected frame=20 >> forward. I have >> uploaded a small video of the new functionality in action here: >> https://mfa.pw/activate-front.mp4 > > Hi, I don't see any problems with this. > >> Please let me know if any modifications would need to be made=20 >> to >> this patch before it could be accepted. > > If you could fill out the commit message in line with=20 > CONTRIBUTE, that > would be great. > > Thanks! --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=activate-front-2.patch Content-Transfer-Encoding: quoted-printable Content-Description: activate-front-2.patch From=206458bf34fd29dbc34ac0f91a087dbaaccc6c13a3 Mon Sep 17 00:00:00 2001 From: Matt Beshara Date: Sun, 6 Jun 2021 13:06:47 +1000 Subject: [PATCH] * src/nsfns.m (Fns_hide_emacs): Allow activating only selected frame MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Causes =E2=80=98ns-hide-emacs=E2=80=99 to layer the selected frame in front= of every other application=E2=80=99s windows, and give that frame keyboard focus, when cal= led with 'activate-front. =2D-- src/nsfns.m | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/nsfns.m b/src/nsfns.m index 98801d8526..454a6fdab6 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+a9rgYVIIu8JuyI3CgUCYMP0JAkcbUBtZmEucHcA CgkQSCLvCbsiNwoVKQD9EJ6+aJCTzc6OfaVl4PlaiOKExoPk0H2iEgDcGDWOMsIA /1ycyMutOUp6sCneZ0Z4/6HPjMnehJizPF0ImQ3+OJUC =KH4B -----END PGP SIGNATURE----- --==-=-=--