-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Don't notify a11y event when in ConPTY mode #10537
Conversation
If I'm not mistaken, this only helps with [[nodiscard]] NTSTATUS WriteChars(...) {
if (!WI_IsFlagSet(screenInfo.OutputMode, ENABLE_VIRTUAL_TERMINAL_PROCESSING) ||
!WI_IsFlagSet(screenInfo.OutputMode, ENABLE_PROCESSED_OUTPUT))
{
return WriteCharsLegacy(screenInfo,
pwchBufferBackupLimit,
pwchBuffer,
pwchRealUnicode,
pcb,
pcSpaces,
sOriginalXPosition,
dwFlags,
psScrollY);
}
// ...
} This saves ~7% CPU time: Before: After: |
It is also called through the default string handling case for the VT state machine engine, to handle all non-VT strings. |
More context on this please? Does it affect UIA? CC @carlos-zamora. |
@codeofdusk two important things here:
It just wastes CPU time doing accessibility (1) poorly and (2) on a disconnected channel nobody is receiving any information from, ever. |
I'm not sure about this approach. There's a lot of accessibility event signalling hooked up to this provider, and doing this thing where we just suppress one of the events is just playing "whack-a-mole." @lhecker -- if we replaced the IAccessibilityThinger with a version that just no-ops for ConPTY... is the cost of a vtable dispatch more expensive than a branch on every output to check if we're in VtIo mode? Replacing it with a no-op IAccessibilityThing will make it easier to get every single place we would have called it -- cursor updates, scrolling, etc etc etc without having to dig through every bit of code. |
Branches are probably a bit cheaper, but I doubt by much; we'd have to measure the impact. Since the vtable approach would be more ergonomic I think we should try that first... |
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.
Actually, I suspect that SCREEN_INFORMATION::NotifyAccessibilityEventing on its own is already too expensive, even if we do a new no-op virtual implementation of IAccessibilityNotifier.
It reads the buffer, does some UCS2 crap, and then calls the vtable.
I think we need to do both.
You should move the check here to be inside NotifyAccessibilityEventing and add a new empty/no-op IAccessibilityNotifier that we can use in InteractivityBase.
Sounds like we're changing the approach, so preemptively dismissing my review
@DHowett I finished the first part and moved the check inside |
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.
I'm okay with this if @miniksa is.
@msftbot make sure @miniksa signs off |
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told 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.
I'm good but I filed a follow on and will send the second half soon. I can see the route to easy completion on it given my history here.
…PTY mode (#10569) Change accessibility notifier creation so we do not create one when we're in PTY mode. (Guard all call sites to skip math/event work when the notifier is null.) MSAA events are legacy events that are registered for globally and used by some screen readers to find content in the conhost window. The PTY mode is not responsible for hosting the display content or input window, so it makes sense for it to not broadcast these events and delegate the accessibility requirement to the connected terminal. ## References - #10537 ## PR Checklist * [x] Closes #10568 * [x] I work here * [x] Manual test launches passed.
…PTY mode (#10569) Change accessibility notifier creation so we do not create one when we're in PTY mode. (Guard all call sites to skip math/event work when the notifier is null.) MSAA events are legacy events that are registered for globally and used by some screen readers to find content in the conhost window. The PTY mode is not responsible for hosting the display content or input window, so it makes sense for it to not broadcast these events and delegate the accessibility requirement to the connected terminal. ## References - #10537 ## PR Checklist * [x] Closes #10568 * [x] I work here * [x] Manual test launches passed. (cherry picked from commit 91b454a)
🎉 Handy links: |
🎉 Handy links: |
Don't notify a11y event when in ConPTY mode
In support of #10528