NSAccessibilityPostNotification may synchronously invoke VoiceOver callbacks from a background AX server thread. Those callbacks call dispatch_sync(main_queue) to read buffer state. If the main thread is still inside the notification-posting method (postAccessibilityUpdates, windowDidBecomeKey, or postAccessibilityNotificationsForFrame), the dispatch_sync deadlocks. Symptom: Emacs hangs on C-x o after M-x list-buffers from Completions buffer, but only with VoiceOver enabled. Fix: introduce ns_ax_post_notification() and ns_ax_post_notification_with_info() wrappers that defer notification posting via dispatch_async(main_queue). This lets the current method return and frees the main queue for VoiceOver's dispatch_sync calls. All 14 notification-posting sites now use the async wrappers.
97 KiB
97 KiB