From 6e1054a40bf6df1429a2b16fdd0d7652dae4d537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Mon, 17 Mar 2025 02:25:21 +0100 Subject: [PATCH] NS: Correct the accessibility role of Emacs windows (bug#77062) Make the accessibility role of Emacs windows to be "standard window" (AXWindow) instead of "text field" (AXTextField). This matches other applications on NS, as can be verified with any accessibility inspector. All widely used NS ports, such as Emacs Plus, have this patch already applied. As for practical impact, this change makes Emacs, for example, work with tiling window managers, such as Yabai, where many users report problems with Emacs specifically, and are instructed to simply avoid the official NS port of GNU Emacs due to this problem. * src/nsterm.m: ([EmacsWindow accessibilityAttributeValue:]): Make the accessibility role of Emacs windows to be "standard window" (AXWindow) instead of "text field" (AXTextField). --- src/nsterm.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index 30a35bdd5b2..b006b4d5dd0 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -9830,7 +9830,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute NSTRACE ("[EmacsWindow accessibilityAttributeValue:]"); if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) - return NSAccessibilityTextFieldRole; + return NSAccessibilityWindowRole; if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute] && curbuf && ! NILP (BVAR (curbuf, mark_active)))