Skip to content
Open
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
11 changes: 11 additions & 0 deletions src/renderer/base/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ void Renderer::EnablePainting()
// but once EnablePainting is called it should be safe to retrieve.
_viewport = _pData->GetViewport();

// _viewport feeds the cursor coordinate (_updateCursorInfo), while the engine's
// backing buffer (e.g. AtlasEngine's _p.rows) is sized from viewportCellCount,
// which only UpdateViewport() writes. If the viewport grew while painting was
// disabled, assigning _viewport here without forcing a resync would let the next
// _CheckViewportAndScroll() early-return (srOldViewport == srNewViewport) and skip
// UpdateViewport(), leaving the engine viewport - and thus the row buffer - behind
// _viewport. The cursor could then be reported as in-viewport at a row past the end
// of the buffer (GH#20269). Force the resync so the backing buffer is resized to
// match before the next cursor move is painted.
_forceUpdateViewport = true;

_enable.SetEvent();

if (const auto guard = _threadMutex.lock_exclusive(); !_thread)
Expand Down
Loading