Skip to content
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

Fix a deadlock and a bounding rects issue in UIA #5385

Merged
2 commits merged into from
Apr 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/types/UiaTextRangeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ IFACEMETHODIMP UiaTextRangeBase::GetBoundingRectangles(_Outptr_result_maybenull_

// these viewport vars are converted to the buffer coordinate space
const auto viewport = bufferSize.ConvertToOrigin(_pData->GetViewport());
const auto viewportOrigin = viewport.Origin();
const til::point viewportOrigin = viewport.Origin();
const auto viewportEnd = viewport.EndExclusive();

// startAnchor: the earliest COORD we will get a bounding rect for
Expand Down Expand Up @@ -426,7 +426,9 @@ IFACEMETHODIMP UiaTextRangeBase::GetBoundingRectangles(_Outptr_result_maybenull_

for (const auto& rect : textRects)
{
_getBoundingRect(rect, coords);
til::rectangle r{ rect };
r -= viewportOrigin;
_getBoundingRect(r, coords);
}
}

Expand Down Expand Up @@ -759,6 +761,8 @@ try
FAIL_FAST_IF(!(newViewport.Bottom <= bottomRow));
FAIL_FAST_IF(!(_getViewportHeight(oldViewport) == _getViewportHeight(newViewport)));

Unlock.reset();

_ChangeViewport(newViewport);

UiaTracing::TextRange::ScrollIntoView(alignToTop, *this);
Expand Down