[PR #5385] [MERGED] Fix a deadlock and a bounding rects issue in UIA #26300

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5385
Author: @DHowett-MSFT
Created: 4/17/2020
Status: Merged
Merged: 4/17/2020
Merged by: @undefined

Base: masterHead: dev/duhowett/uia_fixes


📝 Commits (2)

  • db80275 uia: make bounding rects viewport-relative again
  • 01431af uia: unlock the read lock before triggering a scroll

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 src/types/UiaTextRangeBase.cpp (+6 -2)

📄 Description

The scroll locking rework that landed with the DxRenderer's partial
invalidation change introduced a deadlock. UIA locks the buffer for
reading before asking it to scroll (which now requires a write lock.)

Scrolling is probably okay to have a little bit of torn state that
might arise from us unlocking the read lock early before triggering the
write lock down the line.

While investigating this, I also noticed that our bounding rects stopped
being viewport-relative (and were instead buffer-relative.) That
regressed with the switch to GetTextRects in #4991

PR Checklist

  • Closes (issues noticed in investigating the DPI changes)
  • CLA signed.
  • Tests added/passed
  • Requires documentation to be updated
  • Core contributor badge

Validation Steps Performed

Manual pass with inspect.exe


🔄 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/5385 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 4/17/2020 **Status:** ✅ Merged **Merged:** 4/17/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/duhowett/uia_fixes` --- ### 📝 Commits (2) - [`db80275`](https://github.com/microsoft/terminal/commit/db8027516e0ac36921503bd3afb498d27cdf2207) uia: make bounding rects viewport-relative again - [`01431af`](https://github.com/microsoft/terminal/commit/01431af01b149ad0ac386746b2487c09b339a8ed) uia: unlock the read lock before triggering a scroll ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/types/UiaTextRangeBase.cpp` (+6 -2) </details> ### 📄 Description The scroll locking rework that landed with the DxRenderer's partial invalidation change introduced a deadlock. UIA locks the buffer for reading before asking it to scroll (which now requires a write lock.) Scrolling is probably _okay_ to have a little bit of torn state that might arise from us unlocking the read lock early before triggering the write lock down the line. While investigating this, I also noticed that our bounding rects stopped being viewport-relative (and were instead buffer-relative.) That regressed with the switch to `GetTextRects` in #4991 ## PR Checklist * [ ] Closes (issues noticed in investigating the DPI changes) * [x] CLA signed. * [ ] Tests added/passed * [ ] Requires documentation to be updated * [x] Core contributor badge ## Validation Steps Performed Manual pass with inspect.exe --- <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:15:12 +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#26300