diff options
| author | Stéphane Marks | 2026-04-09 13:09:51 -0400 |
|---|---|---|
| committer | Alan Third | 2026-04-09 21:59:13 +0100 |
| commit | b4da8610cd3091a05f458bcda52ce133e2e9494c (patch) | |
| tree | f80f2d63066b0092615a6782877b358548b8cedf /src | |
| parent | fc128826b537fd0b95cedbc03b70e3466dd68ee2 (diff) | |
| download | emacs-b4da8610cd3091a05f458bcda52ce133e2e9494c.tar.gz emacs-b4da8610cd3091a05f458bcda52ce133e2e9494c.zip | |
; New function 'ns-process-is-accessibility-trusted', no message (bug#80624)
* src/nsfns.m (Fns_process_is_accessibility_trusted): New
function.
(syms_of_nsfns): New defsubr.
* src/nsterm.m: ([EmacsApp applicationDidFinishLaunching:]):
Remove the AXIsProcessTrusted message.
* etc/NEWS: Updated.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsfns.m | 22 | ||||
| -rw-r--r-- | src/nsterm.m | 8 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index ae8e6e30e66..efe622782f7 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -3755,6 +3755,27 @@ DEFUN ("ns-show-character-palette", | |||
| 3755 | return Qnil; | 3755 | return Qnil; |
| 3756 | } | 3756 | } |
| 3757 | 3757 | ||
| 3758 | |||
| 3759 | DEFUN ("ns-process-is-accessibility-trusted", | ||
| 3760 | Fns_process_is_accessibility_trusted, | ||
| 3761 | Sns_process_is_accessibility_trusted, | ||
| 3762 | 0, 0, 0, | ||
| 3763 | doc: /* Return non-nil if Emacs is trusted by macOS Accessibility. | ||
| 3764 | Return nil otherwise or if the OS is not macOS. | ||
| 3765 | This is necessary for Emacs to support Zoom and related accessibility | ||
| 3766 | features. Authorize Emacs for accessibility via System | ||
| 3767 | Settings... Privacy & Security... Accessibility... and add the Emacs.app | ||
| 3768 | installed directory to the enabled application list. */) | ||
| 3769 | (void) | ||
| 3770 | { | ||
| 3771 | #ifdef NS_IMPL_COCOA | ||
| 3772 | if (AXIsProcessTrusted()) | ||
| 3773 | return Qt; | ||
| 3774 | #endif | ||
| 3775 | return Qnil; | ||
| 3776 | } | ||
| 3777 | |||
| 3778 | |||
| 3758 | DEFUN ("ns-badge", Fns_badge, Sns_badge, 1, 1, 0, | 3779 | DEFUN ("ns-badge", Fns_badge, Sns_badge, 1, 1, 0, |
| 3759 | doc: /* Set the app icon badge to BADGE. | 3780 | doc: /* Set the app icon badge to BADGE. |
| 3760 | BADGE should be a string short enough to display nicely in the short | 3781 | BADGE should be a string short enough to display nicely in the short |
| @@ -4248,6 +4269,7 @@ The default value is t. */); | |||
| 4248 | defsubr (&Sns_set_mouse_absolute_pixel_position); | 4269 | defsubr (&Sns_set_mouse_absolute_pixel_position); |
| 4249 | defsubr (&Sns_mouse_absolute_pixel_position); | 4270 | defsubr (&Sns_mouse_absolute_pixel_position); |
| 4250 | defsubr (&Sns_show_character_palette); | 4271 | defsubr (&Sns_show_character_palette); |
| 4272 | defsubr (&Sns_process_is_accessibility_trusted); | ||
| 4251 | defsubr (&Sns_badge); | 4273 | defsubr (&Sns_badge); |
| 4252 | defsubr (&Sns_request_user_attention); | 4274 | defsubr (&Sns_request_user_attention); |
| 4253 | defsubr (&Sns_progress_indicator); | 4275 | defsubr (&Sns_progress_indicator); |
diff --git a/src/nsterm.m b/src/nsterm.m index b16d020ebad..0dbb59344a3 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -6517,14 +6517,6 @@ ns_term_shutdown (int sig) | |||
| 6517 | } | 6517 | } |
| 6518 | #endif | 6518 | #endif |
| 6519 | 6519 | ||
| 6520 | #ifdef NS_IMPL_COCOA | ||
| 6521 | /* Is accessibility enabled for this process/bundle? */ | ||
| 6522 | if (AXIsProcessTrusted()) | ||
| 6523 | NSLog (@"Emacs is macOS AXIsProcessTrusted"); | ||
| 6524 | else | ||
| 6525 | NSLog (@"Emacs is not macOS AXIsProcessTrusted"); | ||
| 6526 | #endif | ||
| 6527 | |||
| 6528 | ns_send_appdefined (-2); | 6520 | ns_send_appdefined (-2); |
| 6529 | } | 6521 | } |
| 6530 | 6522 | ||