aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Marks2026-04-09 13:09:51 -0400
committerAlan Third2026-04-09 21:59:13 +0100
commitb4da8610cd3091a05f458bcda52ce133e2e9494c (patch)
treef80f2d63066b0092615a6782877b358548b8cedf
parentfc128826b537fd0b95cedbc03b70e3466dd68ee2 (diff)
downloademacs-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.
-rw-r--r--etc/NEWS14
-rw-r--r--src/nsfns.m22
-rw-r--r--src/nsterm.m8
3 files changed, 33 insertions, 11 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 90dbca7501b..3639d1b47e8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -4520,9 +4520,17 @@ singleton list.
4520--- 4520---
4521** Support macOS Accessibility Zoom focus tracking. 4521** Support macOS Accessibility Zoom focus tracking.
4522This is an important change for visually-impaired users. If macOS 4522This is an important change for visually-impaired users. If macOS
4523Accessibility Zoom is enabled (System Settings, Accessibility, Zoom) 4523Accessibility Zoom is enabled via (System Settings, Accessibility,
4524with keyboard focus tracking (Advanced...), Zoom is informed of updated 4524Zoom...) with keyboard focus tracking (Advanced...), Zoom is informed
4525cursor positions during each redisplay cycle. 4525of updated cursor positions during each redisplay cycle.
4526
4527---
4528** New macOS function 'ns-process-is-accessibility-trusted'.
4529This function returns t if the macOS Accessibility Framework trusts the
4530Emacs. This is a necessary condition for Accessibility Zoom and other
4531accessibility features. Enable Emacs via (System Settings, Privacy &
4532Security, Accessibility...) and add the Emacs.app installed directory to
4533the enabled application list.
4526 4534
4527--- 4535---
4528** Process execution has been optimized on Android. 4536** Process execution has been optimized on Android.
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
3759DEFUN ("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.
3764Return nil otherwise or if the OS is not macOS.
3765This is necessary for Emacs to support Zoom and related accessibility
3766features. Authorize Emacs for accessibility via System
3767Settings... Privacy & Security... Accessibility... and add the Emacs.app
3768installed 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
3758DEFUN ("ns-badge", Fns_badge, Sns_badge, 1, 1, 0, 3779DEFUN ("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.
3760BADGE should be a string short enough to display nicely in the short 3781BADGE 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