diff options
| author | Matt Beshara | 2021-06-06 13:06:47 +1000 |
|---|---|---|
| committer | Alan Third | 2021-06-12 10:10:51 +0100 |
| commit | 57950515ecb3609bc252ecd0d33c802e04bbad64 (patch) | |
| tree | 3a800a5ceb526001dff8a4dbb5bf8c6a6c76f235 /src | |
| parent | e775ef2f57e7889e29edbf44e6f6a2deb79d2635 (diff) | |
| download | emacs-57950515ecb3609bc252ecd0d33c802e04bbad64.tar.gz emacs-57950515ecb3609bc252ecd0d33c802e04bbad64.zip | |
Add ability to bring only the selected frame to the front (bug#48865)
Causes ‘ns-hide-emacs’ to layer the selected frame in front of every other
application’s windows, and give that frame keyboard focus, when called with
'activate-front.
* src/nsfns.m (Fns_hide_emacs): Allow activating only selected frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsfns.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index 98801d8526f..454a6fdab62 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -1953,8 +1953,11 @@ DEFUN ("ns-hide-emacs", Fns_hide_emacs, Sns_hide_emacs, | |||
| 1953 | doc: /* If ON is non-nil, the entire Emacs application is hidden. | 1953 | doc: /* If ON is non-nil, the entire Emacs application is hidden. |
| 1954 | Otherwise if Emacs is hidden, it is unhidden. | 1954 | Otherwise if Emacs is hidden, it is unhidden. |
| 1955 | If ON is equal to `activate', Emacs is unhidden and becomes | 1955 | If ON is equal to `activate', Emacs is unhidden and becomes |
| 1956 | the active application. */) | 1956 | the active application. |
| 1957 | (Lisp_Object on) | 1957 | If ON is equal to `activate-front', Emacs is unhidden and |
| 1958 | becomes the active application, but only the selected frame | ||
| 1959 | is layered in front of the windows of other applications. */) | ||
| 1960 | (Lisp_Object on) | ||
| 1958 | { | 1961 | { |
| 1959 | check_window_system (NULL); | 1962 | check_window_system (NULL); |
| 1960 | if (EQ (on, intern ("activate"))) | 1963 | if (EQ (on, intern ("activate"))) |
| @@ -1962,6 +1965,12 @@ the active application. */) | |||
| 1962 | [NSApp unhide: NSApp]; | 1965 | [NSApp unhide: NSApp]; |
| 1963 | [NSApp activateIgnoringOtherApps: YES]; | 1966 | [NSApp activateIgnoringOtherApps: YES]; |
| 1964 | } | 1967 | } |
| 1968 | else if (EQ (on, intern ("activate-front"))) | ||
| 1969 | { | ||
| 1970 | [NSApp unhide: NSApp]; | ||
| 1971 | [[NSRunningApplication currentApplication] | ||
| 1972 | activateWithOptions: NSApplicationActivateIgnoringOtherApps]; | ||
| 1973 | } | ||
| 1965 | else if (NILP (on)) | 1974 | else if (NILP (on)) |
| 1966 | [NSApp unhide: NSApp]; | 1975 | [NSApp unhide: NSApp]; |
| 1967 | else | 1976 | else |