-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix resize crash in OpenConsole with AtlasEngine (#13015)
`_api.cellCount` caches the `TextBuffer` size in AtlasEngine. Calculating it based on the `_api.sizeInPixel` is incorrect as the `TextBuffer` size doesn't necessarily have to be the size of the window. This can occur when the window is resized, as the main thread is receiving its `WM_SIZE` message and resizing the `TextBuffer` concurrently with the render thread performing a render pass and AtlasEngine checking the `GetClientRect`. In order to inform `AtlasEngine` about the initial buffer size, `Renderer` was modified to also invoke `UpdateViewport()` on the first render cycle. The only other user of `UpdateViewport()` is `VtEngine` which used to call `InvalidateAll()` in these situations. In order to prevent the `InvalidateAll()` call, `VtEngine::UpdateViewport()` was modified to suppress this. ## Validation Steps Performed * Resizing wide characters doesn't crash the terminal anymore ✅ * The additional call to `UpdateViewport()` doesn't break VtEngine ✅
- Loading branch information
Showing
4 changed files
with
35 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters