-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce PseudoConsoleWindow a11y provider #14541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be very much better if this window could be yeeted out of the a11y tree, because it contains no user-useful information and should not under any circumstances be user-accessible.
This PR fixes the symptom, "the window that nobody should access has no name," rather than the cause -- is it possible to fix the cause?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea hard block. The conpty window, by all accounts, should not be something the user EVER interacts with.
else if (propertyId == UIA_IsControlElementPropertyId) | ||
{ | ||
pVariant->vt = VT_BOOL; | ||
pVariant->boolVal = VARIANT_FALSE; | ||
} | ||
else if (propertyId == UIA_IsContentElementPropertyId) | ||
{ | ||
pVariant->vt = VT_BOOL; | ||
pVariant->boolVal = VARIANT_FALSE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DHowett @zadjii-msft
So, in XAML, you can set the AccessibilityView
to Raw
to remove it from the UIA tree. This is actually an abstraction:
AccessibilityView | IsControlElement | IsContentElement |
---|---|---|
Raw | false | false |
Control | true | false |
Content | true | true |
Source: https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-treeoverview
By setting both of these to false, we're essentially "removing" this from the UIA tree. However, you can't really remove it. It's just accessible if you want the raw version of the tree.
This distinction is particularly important for Accessibility Insights. Unfortunately, the FastPass tool navigates through the UIA tree and looks for common errors. So, it still finds this PseudoConsoleWindow and complains that it needs a name (unfortunately).
To make matters worse, even with this fix where we change it to Raw
and give it a name, we're still getting a bug from FastPass saying that we should set IsControlElement
to true. But for the reasons you've stated, we obviously don't want that.
Idk if there's a way to exclude this window from FastPass. Like we said, it's not focusable. We basically want to completely omit this from the UIA tree, but this is as close as we can get, it seems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Thank you!
HRESULT PseudoConsoleWindowAccessibilityProvider::RuntimeClassInitialize(HWND pseudoConsoleHwnd) noexcept | ||
{ | ||
RETURN_HR_IF_NULL(E_INVALIDARG, pseudoConsoleHwnd); | ||
_pseudoConsoleHwnd = pseudoConsoleHwnd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any compelling need for the PCWAP to keep a handle to its owning window?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just this:
terminal/src/interactivity/base/InteractivityFactory.cpp
Lines 107 to 112 in 767cabf
IFACEMETHODIMP PseudoConsoleWindowAccessibilityProvider::get_HostRawElementProvider(_COM_Outptr_result_maybenull_ IRawElementProviderSimple** ppProvider) | |
{ | |
RETURN_HR_IF_NULL(E_INVALIDARG, ppProvider); | |
RETURN_HR_IF_NULL(gsl::narrow_cast<HRESULT>(UIA_E_ELEMENTNOTAVAILABLE), _pseudoConsoleHwnd); | |
return UiaHostProviderFromHwnd(_pseudoConsoleHwnd, ppProvider); | |
} |
else if (propertyId == UIA_IsControlElementPropertyId) | ||
{ | ||
pVariant->vt = VT_BOOL; | ||
pVariant->boolVal = VARIANT_FALSE; | ||
} | ||
else if (propertyId == UIA_IsContentElementPropertyId) | ||
{ | ||
pVariant->vt = VT_BOOL; | ||
pVariant->boolVal = VARIANT_FALSE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/interactivity/base/PseudoConsoleWindowAccessibilityProvider.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation yesterday - we need to add UIA support, so that we can tell UIA that we aren't a thing. Crazy, but okay.
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
In order to modify the accessibility information for the PseudoConsoleWindow, it needs to have a UIA provider registered. This PR introduces `PseudoConsoleWindowAccessibilityProvider` and registers it as a UIA provider appropriately. The registration process is based on that of the `WindowUiaProvider` for ConHost. Closes #14385 ## Validation Steps Performed Run Accessibility Insights FastPass on the window. The PseudoConsoleWindow no longer is tagged as missing a name. (cherry picked from commit 09273be) Service-Card-Id: 87568605 Service-Version: 1.16
🎉 Handy links: |
🎉 Handy links: |
In order to modify the accessibility information for the PseudoConsoleWindow, it needs to have a UIA provider registered. This PR introduces
PseudoConsoleWindowAccessibilityProvider
and registers it as a UIA provider appropriately. The registration process is based on that of theWindowUiaProvider
for ConHost.Closes #14385
Validation Steps Performed
Run Accessibility Insights FastPass on the window. The PseudoConsoleWindow no longer is tagged as missing a name.