unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Matt Beshara <m@mfa.pw>
To: 48864@debbugs.gnu.org
Subject: bug#48864: [PATCH] Allow ‘ns-hide-emacs’ to bring only the selected frame forward
Date: Sun, 06 Jun 2021 15:18:45 +1000	[thread overview]
Message-ID: <m27dj7y3ii.fsf@mfa.pw> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="=-=-=", Size: 3073 bytes --]

-----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 <m@mfa.pw>
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-----





                 reply	other threads:[~2021-06-06  5:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27dj7y3ii.fsf@mfa.pw \
    --to=m@mfa.pw \
    --cc=48864@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).