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 crash when resizing conhost in Debug #13001

Merged
merged 1 commit into from
Apr 29, 2022
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
4 changes: 1 addition & 3 deletions src/renderer/base/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ void Renderer::TriggerRedrawCursor(const COORD* const pcoord)
// The region is clamped within the viewport boundaries and we only
// trigger a redraw if the region is not empty.
auto view = _pData->GetViewport();
cursorView = view.Clamp(cursorView);

if (cursorView.IsValid())
if (view.IsInBounds(cursorView))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a strange way for us to do this. And IsInBounds doesn't beef? Neat!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the old way was strange.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's a bit late to tell you now, but I don't think this is right. I haven't had a chance to check, but I think IsInBounds is testing whether the whole cursorView is inside the view, but that means a cursor that is partially off screen is probably not going to be refreshed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmmm..

Would this come up when the cursor is on a double-width glyph and the viewport is scrolled such that it cuts that glyph in half?

Copy link
Collaborator

@j4james j4james Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Also on a double-width line, or even a double-width glyph on a double-width line, which can be four cells wide.

{
const auto updateRect = view.ConvertToOrigin(cursorView).ToExclusive();
FOREACH_ENGINE(pEngine)
Expand Down