From unknown Sat Sep 20 00:36:45 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#79471 <79471@debbugs.gnu.org> To: bug#79471 <79471@debbugs.gnu.org> Subject: Status: [PATCH] Add basic macOS acccessibility support for frames Reply-To: bug#79471 <79471@debbugs.gnu.org> Date: Sat, 20 Sep 2025 07:36:45 +0000 retitle 79471 [PATCH] Add basic macOS acccessibility support for frames reassign 79471 emacs submitter 79471 Dani Brown severity 79471 normal tag 79471 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 00:33:25 2025 Received: (at submit) by debbugs.gnu.org; 19 Sep 2025 04:33:25 +0000 Received: from localhost ([127.0.0.1]:35931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uzSoG-0003Ow-8A for submit@debbugs.gnu.org; Fri, 19 Sep 2025 00:33:25 -0400 Received: from lists.gnu.org ([2001:470:142::17]:46622) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uzJfI-0007VN-V8 for submit@debbugs.gnu.org; Thu, 18 Sep 2025 14:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzJfB-0001VN-1a for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2025 14:47:26 -0400 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uzJf8-0002eB-PW for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2025 14:47:24 -0400 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 48ECDEC01B0 for ; Thu, 18 Sep 2025 14:47:16 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 18 Sep 2025 14:47:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dani.cool; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm1; t=1758221236; x=1758307636; bh=zB1dHqtjEz2KDYF4rKBfMHDZKPkeyil4 RpZH3SgCdRs=; b=YEnZAmybp3f2WW8iAZEzMHtE9fjgp7Bppo5hrsSa3+lIlJ7c XkXE7fYMOzQyEAOMrvMeZYKAl9eSnbcOO2bgn+f29e8l+P9kwWK7LqoLd0+CEuCf 9jxkgiUSE6+KpUs1kq2bvOi2EAedvFBsx3MtEQmgDnL87PZhetrFJgI7gf2+zSft KjswD+PDKNWOjs+DfNPmARASeDKpbQEJaNhHwROZwP6Wxchcfu1pu1qg4+bk1W2H YPH6ervfScxzJpSWnAbPLtVyKWjX4G2YKzkGENappvgPlnXvm4KHaa8GIx++g707 ENpd6c89jchtMI3zq34Lv8VjJka5y0eqJBzHIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1758221236; x= 1758307636; bh=zB1dHqtjEz2KDYF4rKBfMHDZKPkeyil4RpZH3SgCdRs=; b=m SsIkxsLUQw0dpz8y3ab3PGI5FO5xPtDgq653GLZxIsXWe3n9J1PSNkUmNVohZlF8 6s4mL9laYOGhw1VC/SX8NExaZAASlXsSvN8cyonRTCj61ypKkZKuT2NE6VtxyMyS 7Px6dDoKZExEjOSYIPdHSe2Xjx3HGaI9isHG95FQqBLm4oVjEYfp5048d8JLmlMT XHSNgQE4fKSgTGJpmGrGzECmHPU/Q8UbsTkq9MIuhfiHe7f+QvnhCqC6MI4pJcj4 7RfS1LcAMT/N+SnBoPnwglMnPK8jf7P92OQlaiAMdqrgyhnSn8BmgBgwz5Ap4oLP jLIO6tZOrX+Hoxwp1hhEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdegjedtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephfgtggfukfffvffosehmtdhmrehhtdejne cuhfhrohhmpeffrghnihcuuehrohifnhcuoegusegurghnihdrtghoohhlqeenucggtffr rghtthgvrhhnpeehgfevhfdvgfffgefftdfgvefgveeghfeutdevhfdvjeevveehjeettd duiedvheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pegusegurghnihdrtghoohhlpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i16314712:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 18 Sep 2025 14:47:15 -0400 (EDT) From: Dani Brown Content-Type: multipart/mixed; boundary="Apple-Mail=_73FC3ABD-C397-4A1D-B273-115FC75E390E" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: [PATCH] Add basic macOS acccessibility support for frames Message-Id: <715A4C11-C16A-474B-84E2-A6076D9C0914@dani.cool> Date: Thu, 18 Sep 2025 19:47:04 +0100 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3826.700.81) Received-SPF: pass client-ip=103.168.172.145; envelope-from=d@dani.cool; helo=fout-a2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 19 Sep 2025 00:33:22 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --Apple-Mail=_73FC3ABD-C397-4A1D-B273-115FC75E390E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, When trying to find Emacs frames with a macOS window-switching utility (Raycast's window listing, if you're interested), I saw that they didn't get listed. This appears to be the same reason that, before this patch, no windows get returned by the following AppleScript: tell application "System Events" to get every window of (first process = whose name is "Emacs") After this patch, they do, along with their names as set by Emacs. And they also get listed as expected by Raycast. Incidentally this doesn't affect all utilities of this type. Contexts, for instance, was always able to find Emacs frames. I guess it uses a lower-level API. Still, this seems an improvement. Thanks In GNU Emacs 30.2 (build 1, aarch64-apple-darwin24.6.0, NS appkit-2575.70 Version 15.6.1 (Build 24G90)) Windowing system distributor 'Apple', version 10.3.2575 System Description: macOS 15.6.1 Configured using: 'configure --prefix=3D/nix/store/yy4d1whcafa8za1y4jn0zix8gic1xvyh-emacs-pgtk-30.2 --disable-build-details --with-modules --disable-ns-self-contained --with-ns --with-compress-install --with-toolkit-scroll-bars --with-native-compilation --without-imagemagick --with-mailutils --without-small-ja-dic --with-tree-sitter --without-xinput2 --without-xwidgets --without-dbus --without-selinux=E2=80=99 --Apple-Mail=_73FC3ABD-C397-4A1D-B273-115FC75E390E Content-Disposition: attachment; filename=0001-Add-basic-macOS-acccessibility-support-for-frames.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Add-basic-macOS-acccessibility-support-for-frames.patch" Content-Transfer-Encoding: quoted-printable =46rom=20bce696e8a7cfe3209630daf5a5ba60b02c55e413=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Dani=20Brown=20=0ADate:=20Sun,=20= 14=20Sep=202025=2020:27:13=20+0100=0ASubject:=20[PATCH]=20Add=20basic=20= macOS=20acccessibility=20support=20for=20frames=0A=0AAllow=20frames=20to=20= be=20listed=20by=20macOS=20System=20Events.=0A*=20src/nsterm.h=20= (EmacsWindow):=20Add=20NSAccessibility=20protocol=0A*=20src/nsterm.m=20= (EmacsWindow):=20Implement=20NSAccessibility=0A---=0A=20src/nsterm.h=20|=20= =202=20+-=0A=20src/nsterm.m=20|=2022=20++++++++++++++++++++++=0A=202=20= files=20changed,=2023=20insertions(+),=201=20deletion(-)=0A=0Adiff=20= --git=20a/src/nsterm.h=20b/src/nsterm.h=0Aindex=20= d9d16ffabd3..03193f83151=20100644=0A---=20a/src/nsterm.h=0A+++=20= b/src/nsterm.h=0A@@=20-416,7=20+416,7=20@@=20enum=20ns_return_frame_mode=0A= =20=20=20};=0A=20=0A=20/*=20EmacsWindow=20=20*/=0A-@interface=20= EmacsWindow=20:=20NSWindow=0A+@interface=20EmacsWindow=20:=20NSWindow=20= =0A=20{=0A=20=20=20NSPoint=20grabOffset;=0A=20=20=20= NSEvent=20*last_drag_event;=0Adiff=20--git=20a/src/nsterm.m=20= b/src/nsterm.m=0Aindex=205127739e2d9..34b49c51adf=20100644=0A---=20= a/src/nsterm.m=0A+++=20b/src/nsterm.m=0A@@=20-10284,6=20+10284,28=20@@=20= -=20(NSDragOperation)=20beginDrag:=20(NSDragOperation)=20op=0A=20=20=20= return=20selected_op;=0A=20}=0A=20=0A+/*=20Accessibility=20support=20for=20= System=20Events=20and=20AppleScript=20*/=0A+-=20(NSString=20= *)accessibilityRole=0A+{=0A+=20=20return=20NSAccessibilityWindowRole;=0A= +}=0A+=0A+-=20(NSString=20*)accessibilityTitle=0A+{=0A+=20=20return=20= self.title;=0A+}=0A+=0A+-=20(BOOL)isAccessibilityElement=0A+{=0A+=20=20= return=20YES;=0A+}=0A+=0A+-=20(NSArray=20*)accessibilityChildren=0A+{=0A= +=20=20NSArray=20*children=20=3D=20[super=20accessibilityChildren];=0A+=20= =20return=20children=20?=20children=20:=20@[];=0A+}=0A+=0A=20@end=20/*=20= EmacsWindow=20*/=0A=20=0A=20=0A--=20=0A2.50.1=0A=0A= --Apple-Mail=_73FC3ABD-C397-4A1D-B273-115FC75E390E--