Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lock when changing selection endpoint on wheel/auto-scroll (#5551)
Takes the lock inside two routines in `TermControl` that were changing the selection endpoint while a rendering frame was still drawing, resulting in several variants of graphical glitches from double-struck selection boxes to duplicated line text. ## References - Introduced with #5185 ## PR Checklist * [x] Closes #5471 * [x] Already signed life away to company. * [x] Manual tests passed since it's visual. * [x] No extra doc besides the comments. * [x] Am core contributor: Roar. The renderer base and specific renderer engine do a lot of work to remember the previous selection and compensate for scrolling regions and deltas between frames. However, all that work doesn't quite match up when the endpoints are changed out from under it. Unfortunately, `TermControl` doesn't have a robust history of locking correctly in step with the renderer nor does the renderer's `IRenderData` currently provide any way of 'snapping' state at the beginning of a frame so it could work without a full lock. So the solution for now is for the methods that scroll the display in `TermControl` to take the lock that is shared with the renderer's frame painter so they can't change out of sync. ## Validation Steps Performed - Opened terminal with Powershell core. Did ls a bunch of times. Clicked to make selection and held mouse button while wheeling around. - Opened terminal with Powershell core.; Did ls a bunch of times. Clicked to make selection and dragged mouse outside the window to make auto scroll happen. - Opened terminal with Powershell core. Did ls a bunch of times. Clicked to make selection and released. Wheeled around like a crazy person to make sure I didn't regress that.
- Loading branch information