-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Rewrite the MSAA/UIA integration into conhost #19344
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
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.
55/70
@@ -253,12 +253,13 @@ static FillConsoleResult FillConsoleImpl(SCREEN_INFORMATION& screenInfo, FillCon | |||
ImageSlice::EraseCells(screenInfo.GetTextBuffer(), startingCoordinate, result.cellsModified); | |||
} | |||
|
|||
if (screenBuffer.HasAccessibilityEventing()) |
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 think we did this check to explicitly avoid doing any extra work in the ConPTY case
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 still skips the work, but inside the class. I think that putting the work for checks like this into the caller's responsibility is bad. It's repetitive, you can accidentally forget it and doesn't even meaningfully improve performance over doing the check inside the callsite.
IMO good performance improvements address "big picture" issues. This then frees us up to do "cleaner" code like this which is technically wasteful but not practically so.
const auto& bufferBefore = gci.GetActiveOutputBuffer(); | ||
const auto cursorBefore = bufferBefore.GetTextBuffer().GetCursor().GetPosition(); | ||
|
||
auto raise = wil::scope_exit([&bufferBefore, cursorBefore] { |
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.
hit this with AVRF please. I'm worried about capturing this reference by reference.
can we just capture the pointer itself, since all we do is compare it?
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.
AFAIK lambda captures behave like auto
so bufferBefore
would capture a copy, not a reference. But I agree that capturing a pointer would be easier to read and understand.
notifier->NotifyConsoleUpdateScrollEvent(0, -1); | ||
} | ||
auto& an = ServiceLocator::LocateGlobals().accessibilityNotifier; | ||
an.ScrollBuffer(-1); |
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.
this used to be skipped in conpty - note to self to verify it still is
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.
(a11y eventing is disabled in ConPTY because the Window
class doesn't get instantiated.)
// Flags is expected to be 2, 1, or 0. 2 in selecting (whether or not visible), 1 if just visible, 0 if invisible/noselect. | ||
if (WI_IsFlagSet(gci.Flags, CONSOLE_SELECTING)) | ||
{ | ||
flags = IAccessibilityNotifier::ConsoleCaretEventFlags::CaretSelection; |
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.
📝 watch where Selection/Invisible/Visible go
@@ -47,6 +47,7 @@ | |||
<ClCompile Include="..\writeData.cpp" /> | |||
<ClCompile Include="..\_output.cpp" /> | |||
<ClCompile Include="..\_stream.cpp" /> | |||
<ClCompile Include="..\AccessibilityNotifier.cpp" /> |
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.
add to sources.inc
void RemoteConsoleControl::Control(ControlType, PVOID, DWORD) noexcept | ||
{ | ||
WI_ASSERT_FAIL(); | ||
} | ||
|
||
void RemoteConsoleControl::NotifyWinEvent(DWORD, HWND, LONG, LONG) noexcept | ||
{ | ||
WI_ASSERT_FAIL(); | ||
} |
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.
you need to test this out as a handoff recipient to verify these asserts never hit
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.
Will do. Theoretically nothing will happen because AccessibilityNotifier
only exists if the Window
class has been loaded.
@@ -16,7 +16,6 @@ | |||
</ClCompile> | |||
</ItemDefinitionGroup> | |||
<ItemGroup> | |||
<ClCompile Include="..\AccessibilityNotifier.cpp" /> |
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.
update sources
Goal: Remove
CursorBlinker
.Problem: Spooky action at a distance via
Cursor::HasMoved
.Solution: Moved all the a11y event raising into
_stream.cpp
and pray for the best.Goal: Prevent node.js from tanking conhost performance via MSAA (WHY).
Problem:
ServiceLocator
.Solution: Unserviced the locator. Debounced event raising. Performance increased by >10x.
Problem 2: Lots of files changed.
This PR is a prerequisite for #19330
Validation Steps Performed
Ran NVDA with and without UIA enabled and with different delays. ✅