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).
This commit is contained in:
Rudolf Adamkovič 2025-03-17 02:25:21 +01:00 committed by Alan Third
parent a6e0bb92bb
commit 6e1054a40b

View file

@ -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)))