[PR #1691] [MERGED] Accessibility: Set-up UIA Tree #24646

Open
opened 2026-01-31 09:04:33 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/1691
Author: @carlos-zamora
Created: 6/28/2019
Status: ✅ Merged
Merged: 7/29/2019
Merged by: @carlos-zamora

Base: master ← Head: dev/cazamor/accessibility


📝 Commits (10+)

  • 2be5ff2 - Created IWindow as a common interface to IConsoleWindow and BaseWindow
  • 4c6faec ConHost is building again. Wrong ScreenInfoUiaProvider (SIUP) is being used.
  • c1ce169 - Replaced IWindow with IConsoleWindow
  • 65dc3ff Fixed rebase onto master
  • 8290f78 CODE FORMATTING
  • 7417a9a Accessibility: Finalized Shared UIA Tree Model (#1915)
  • 867412a included some "using Microsoft::Console::Types" to make code prettier
  • a815b42 Changed IslandWindow from IConsoleWindow --> IUiaWindow
  • 3eb9947 Moar PR changes
  • fc1ad7d PR Changes

📊 Changes

46 files changed (+1732 additions, -1149 deletions)

View changed files

📝 src/cascadia/TerminalCore/Terminal.hpp (+17 -1)
📝 src/cascadia/TerminalCore/TerminalSelection.cpp (+1 -1)
📝 src/cascadia/TerminalCore/terminalrenderdata.cpp (+27 -0)
📝 src/cascadia/WindowsTerminal/BaseWindow.h (+28 -2)
📝 src/cascadia/WindowsTerminal/IslandWindow.cpp (+24 -0)
📝 src/cascadia/WindowsTerminal/IslandWindow.h (+39 -1)
➕ src/cascadia/WindowsTerminal/WindowUiaProvider.cpp (+163 -0)
➕ src/cascadia/WindowsTerminal/WindowUiaProvider.hpp (+53 -0)
📝 src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj (+2 -0)
📝 src/cascadia/WindowsTerminal/pch.h (+1 -0)
📝 src/host/renderData.cpp (+90 -0)
📝 src/host/renderData.hpp (+16 -0)
📝 src/host/screenInfo.hpp (+1 -1)
📝 src/host/scrolling.cpp (+1 -0)
📝 src/host/selection.cpp (+1 -0)
📝 src/host/selection.hpp (+1 -1)
📝 src/host/srvinit.cpp (+1 -1)
📝 src/host/tracing.cpp (+32 -27)
📝 src/host/tracing.hpp (+6 -11)
📝 src/interactivity/base/ServiceLocator.cpp (+1 -0)

...and 26 more files

📄 Description

Summary of the Pull Request

I touched A LOT of files. The main reason for this is that the WindowUiaProvider was moved to Microsoft::Console::Types so that it can be accessed by both projects. This meant we had to make a lot of propagating changes. But more info on that later.

The Basics of Accessibility

  • What is a User Interaction Automation (UIA) Tree?
  • Other projects (i.e.: Narrator) can take advantage of this UIA tree and are used to present information within it.
  • Some things like XAML already have a UIA Tree. So some UIA tree navigation and features are already there. It's just a matter of getting them hooked up and looking right.

Accessibility in our Project
There's a few important classes...
regarding Accessibility...

  • WindowUiaProvider: This sets up the UIA tree for a window. So this is the top-level for the UIA tree.
  • ScreenInfoUiaProvider: This sets up the UIA tree for a terminal buffer.
  • UiaTextRange: This is essential to interacting with the UIA tree for the terminal buffer. Actually gets portions of the buffer and presents them.

regarding the Windows Terminal window...

  • BaseWindow: The foundation to a window. Deals with HWNDs and that kind of stuff.
  • IslandWindow: This extends BaseWindow and is actually what holds our Windows Terminal
  • NonClientIslandWindow: An extension of the IslandWindow

regarding ConHost...

  • IConsoleWindow: This is an interface for the console window.
  • Window: This is the actual window for ConHost. Extends IConsoleWindow

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • IConsoleWindow changes:
    • move into Microsoft::Console::Types (a shared space)
    • Have IslandWindow extend it
  • WindowUiaProvider changes:
    • move into Microsoft::Console::Types (a shared space)
  • Hook up WindowUiaProvider to IslandWindow (yay! we now have a tree)

Validation Steps Performed

I used "inspect.exe" to verify that the tree is hooked up. Verified this on ConHost and Windows Terminal.

Comments after merging in PR #1915

Please refer to #1915 for a large chunk of the work done here. There are also a few known issues/TODOs that carry over:


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/1691 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 6/28/2019 **Status:** ✅ Merged **Merged:** 7/29/2019 **Merged by:** [@carlos-zamora](https://github.com/carlos-zamora) **Base:** `master` ← **Head:** `dev/cazamor/accessibility` --- ### 📝 Commits (10+) - [`2be5ff2`](https://github.com/microsoft/terminal/commit/2be5ff20fb9339cddbb101bc0dcddf2d41356fb5) - Created IWindow as a common interface to IConsoleWindow and BaseWindow - [`4c6faec`](https://github.com/microsoft/terminal/commit/4c6faecac014f8fbab3f105f7b7eb6bfb9288ac1) ConHost is building again. Wrong ScreenInfoUiaProvider (SIUP) is being used. - [`c1ce169`](https://github.com/microsoft/terminal/commit/c1ce16972c9eaf1f645ce720606366d182d5534b) - Replaced IWindow with IConsoleWindow - [`65dc3ff`](https://github.com/microsoft/terminal/commit/65dc3ff1a5f6aefa43eb91710344a71c617977b2) Fixed rebase onto master - [`8290f78`](https://github.com/microsoft/terminal/commit/8290f78b7f75d88c89903686b1d2199e1b12b02c) CODE FORMATTING - [`7417a9a`](https://github.com/microsoft/terminal/commit/7417a9a1cbd7e6557d7a0dea4b0480363dc4914c) Accessibility: Finalized Shared UIA Tree Model (#1915) - [`867412a`](https://github.com/microsoft/terminal/commit/867412ae76f90263fe92897a18a8d4ba0664fd0b) included some "using Microsoft::Console::Types" to make code prettier - [`a815b42`](https://github.com/microsoft/terminal/commit/a815b42ffa94d2724beedefbc9ff065c573791cf) Changed IslandWindow from IConsoleWindow --> IUiaWindow - [`3eb9947`](https://github.com/microsoft/terminal/commit/3eb9947a816b12286cbf9ad4b5b3d8d025d07d89) Moar PR changes - [`fc1ad7d`](https://github.com/microsoft/terminal/commit/fc1ad7d33a1b93fe0cca88a0643072c9e8fed31e) PR Changes ### 📊 Changes **46 files changed** (+1732 additions, -1149 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+17 -1) 📝 `src/cascadia/TerminalCore/TerminalSelection.cpp` (+1 -1) 📝 `src/cascadia/TerminalCore/terminalrenderdata.cpp` (+27 -0) 📝 `src/cascadia/WindowsTerminal/BaseWindow.h` (+28 -2) 📝 `src/cascadia/WindowsTerminal/IslandWindow.cpp` (+24 -0) 📝 `src/cascadia/WindowsTerminal/IslandWindow.h` (+39 -1) ➕ `src/cascadia/WindowsTerminal/WindowUiaProvider.cpp` (+163 -0) ➕ `src/cascadia/WindowsTerminal/WindowUiaProvider.hpp` (+53 -0) 📝 `src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj` (+2 -0) 📝 `src/cascadia/WindowsTerminal/pch.h` (+1 -0) 📝 `src/host/renderData.cpp` (+90 -0) 📝 `src/host/renderData.hpp` (+16 -0) 📝 `src/host/screenInfo.hpp` (+1 -1) 📝 `src/host/scrolling.cpp` (+1 -0) 📝 `src/host/selection.cpp` (+1 -0) 📝 `src/host/selection.hpp` (+1 -1) 📝 `src/host/srvinit.cpp` (+1 -1) 📝 `src/host/tracing.cpp` (+32 -27) 📝 `src/host/tracing.hpp` (+6 -11) 📝 `src/interactivity/base/ServiceLocator.cpp` (+1 -0) _...and 26 more files_ </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request I touched A LOT of files. The main reason for this is that the `WindowUiaProvider` was moved to `Microsoft::Console::Types` so that it can be accessed by both projects. This meant we had to make a lot of propagating changes. But more info on that later. **The Basics of Accessibility** - [What is a User Interaction Automation (UIA) Tree?](https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-tree-overview) - Other projects (i.e.: Narrator) can take advantage of this UIA tree and are used to present information within it. - Some things like XAML already have a UIA Tree. So some UIA tree navigation and features are already there. It's just a matter of getting them hooked up and looking right. **Accessibility in our Project** There's a few important classes... regarding Accessibility... - **WindowUiaProvider**: This sets up the UIA tree for a window. So this is the top-level for the UIA tree. - **ScreenInfoUiaProvider**: This sets up the UIA tree for a terminal buffer. - **UiaTextRange**: This is essential to interacting with the UIA tree for the terminal buffer. Actually gets portions of the buffer and presents them. regarding the Windows Terminal window... - **BaseWindow**: The foundation to a window. Deals with HWNDs and that kind of stuff. - **IslandWindow**: This extends `BaseWindow` and is actually what holds our Windows Terminal - **NonClientIslandWindow**: An extension of the `IslandWindow` regarding ConHost... - **IConsoleWindow**: This is an interface for the console window. - **Window**: This is the actual window for ConHost. Extends `IConsoleWindow` <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] Closes #634 * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments - `IConsoleWindow` changes: - move into `Microsoft::Console::Types` (a shared space) - Have `IslandWindow` extend it - `WindowUiaProvider` changes: - move into `Microsoft::Console::Types` (a shared space) - Hook up `WindowUiaProvider` to IslandWindow (yay! we now have a tree) <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed I used "inspect.exe" to verify that the tree is hooked up. Verified this on ConHost and Windows Terminal. ## Comments after merging in PR #1915 Please refer to #1915 for a large chunk of the work done here. There are also a few known issues/TODOs that carry over: - [ ] ConHost: the UIA Rects for the caption buttons are missing. Still investigating this issue. - [ ] Issue #1914 - Tracing needs to be reattached - [ ] Issue #1352 - Windows Terminal: the ScreenInfoUiaProvider needs to be attached to the TermControl. - [ ] #1993 - [ ] #1992 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:04:33 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24646