Subject: bug#77062: closed (Re: bug#77062: [PATCH] NS: Correct the accessibility role of Emacs windows)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 31 Jul 2025 21:29:02 +0000

Your bug report

#77062: [PATCH] NS: Correct the accessibility role of Emacs windows

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
77062: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77062
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#77062: [PATCH] NS: Correct the accessibility role of Emacs windows
From: Alan Third <[email-masked]>
To: Robert Pluim <[email-masked]>
Cc: [email-masked], Eli Zaretskii <[email-masked]>, [email-masked]
Date: Thu, 31 Jul 2025 22:28:08 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

On Wed, Jul 30, 2025 at 03:02:56PM +0200, Robert Pluim wrote:
> >>>>> On Wed, 30 Jul 2025 15:31:34 +0300, Eli Zaretskii <[email-masked]> said:
> 
>     >> Cc: [email-masked]
>     >> From: Robert Pluim <[email-masked]>
>     >> Date: Wed, 30 Jul 2025 09:45:54 +0200
>     >> 
>     >> >>>>> On Mon, 31 Mar 2025 03:34:21 +0200, Rudolf Adamkovič <[email-masked]> said:
>     >> 
>     Rudolf> Rudolf Adamkovič <[email-masked]> writes:
>     >> >> See the commit message in the patch.
>     >> 
>     Rudolf> Ping.
>     >> 
>     >> This doesnʼt cause any harm in my testing (with the standard macOS
>     >> window manager). Eli?
> 
>     Eli> I don't understand what that does, and thus don't have any opinion.
> 
>     Eli> Generally speaking, it would be nice to see some official document or
>     Eli> standard saying that this is what applications on macOS should do, and
>     Eli> then have it in the comments to the code.
> 
> I couldnʼt find such a document, but itʼs pretty obvious that
> 
> - Emacs is a windowed application, so claiming itʼs a text field is wrong
> - Other Emacs ports report that it is the right thing to do
> 
> Robert

Pushed to master (6e1054a40bf6df1429a2b16fdd0d7652dae4d537).

Two points, neither really relevant I don't suppose.

I could have sworn we already had at least one, and possibly more, bug
reports open about this, but I can't find any.

And I find it hard to believe we actually have to set this, surely
it's the default? I'm rather sceptical of the original change.

-- 
Alan Third

Subject: [PATCH] NS: Correct the accessibility role of Emacs windows
From: Rudolf Adamkovič <[email-masked]>
To: [email-masked]
Date: Mon, 17 Mar 2025 02:55:05 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

See the commit message in the patch.

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.3.0, NS
 appkit-2575.40 Version 15.3.1 (Build 24D70)) of 2025-03-17 built on
 skynet.local
Repository revision: eab14d68b2e72b9a6b8b0cc67c9667c2bfbed4f5
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.3.1

Configured using:
 'configure --with-json --with-tree-sitter --with-sqlite3
 --with-native-compilation=aot'

>From a8cb24f9069de15b1ac5a31ee85079fbc4376ed9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <[email-masked]>
Date: Mon, 17 Mar 2025 02:25:21 +0100
Subject: [PATCH] NS: Correct the accessibility role of Emacs windows

* src/nsterm.m: ([EmacsWindow accessibilityAttributeValue:]): 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 46bb3f5dd7a..45526d96910 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -9722,7 +9722,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)))
-- 
2.39.5 (Apple Git-154)

-- 
"Chop your own wood and it will warm you twice."
--- Henry Ford; Francis Kinloch, 1819; Henry David Thoreau, 1854

Rudolf Adamkovič <[email-masked]> [he/him]
http://adamkovic.org