Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 missing call to UpdateViewport::UpdateViewport during tearout #15175
Fix missing call to UpdateViewport::UpdateViewport during tearout #15175
Changes from 1 commit
0adf75b
daab106
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
So, as it turns out, it's actually a
DxRenderer
bug which just happens to mask the other bug inRenderer
, fixed here. 😄DxRenderer
doesn't use theIRenderEngine::UpdateViewport
function.UpdateViewport
was probably intended originally to tell the renderer the size of the text buffer.It just happens to not cause any harm to Windows Terminal specifically, because it calls
IRenderEngine::SetWindowSize
andTerminal::UserResize
while holding the console lock across both calls. So the renderer size and text buffer size always stay in sync. This isn't true for conhost though which uses an asynchronous approach to window resizing: The text buffer is resized on the window message thread, while the renderer thread is "free running" and only gets the current window size when it decides to paint. But by that point the window size might be different from the text buffer size.This causes
DxRenderer
to crash with a SIGSEGV when you resize the OpenConsole window too quickly.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 also scares me, since it impacts GDI and WDDM and BGFX!
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’s more correct however since the only reason this member exists is because
EnablePainting
overwrites_viewport
which it absolutely should not do. There’s no guarantee that theIRenderData
has a valid viewport at that point. Because it overwrites_viewport
we need this Boolean to ensureUpdateViewport
is called anyways. So in a sense this is more correct because it puts the overwrite to where the mistake is happening in the first place.