Repository navigation
Fix scrolling with SetConsoleWindowInfo - #16334
Merged
Mike Griese (zadjii-msft) merged 1 commit intoNov 27, 2023
Merged
Mike Griese (zadjii-msft) merged 1 commit into
Mike Griese (zadjii-msft) merged 1 commit into
Conversation
| // - <none> | ||
| void Renderer::TriggerRedraw(const Viewport& region) | ||
| { | ||
| auto view = _viewport; |
There was a problem hiding this comment.
HAH. But then, shouldn't we get rid of the entire cached viewport? We're just kicking the "torn state" can down the road...
Member
Author
There was a problem hiding this comment.
In the past scrolling was entirely implicit in the renderer as it computed the scroll and its invalidation just from the previous and current viewport. Nowadays we also got explicit scrolling, presumably for ConPTY edit: it was added with v2. Unfortunately (and similar to other parts here), the old code never got removed/unified and so we need to retain the behavior for both.
Dustin L. Howett (DHowett)
approved these changes
Nov 17, 2023
Mike Griese (zadjii-msft)
approved these changes
Nov 21, 2023
Mike Griese (zadjii-msft)
deleted the
dev/lhecker/15932-SetConsoleWindowInfo-scrolling
branch
November 27, 2023 21:34
Dustin L. Howett (DHowett)
pushed a commit
that referenced
this pull request
Dec 4, 2023
81b7e54 caused a regression in `SetConsoleWindowInfo` and any other function that used the `WriteToScreen` helper. This is because it assumes that it can place the viewport anywhere randomly and it was written at a time where `TriggerScroll` didn't exist yet (there was no need for that (also not today, but that's being worked on)). Caching the viewport meant that `WriteToScreen`'s call to `TriggerRedraw` would pick up the viewport from the last rendered frame, which would cause the intersection of both to be potentially empty and nothing to be drawn on the screen. This commit reverts 81b7e54 as I found that it has no or negligible impact on performance at this point, likely due to the overall vastly better performance of conhost nowadays. Closes #15932 ## Validation Steps Performed * Scroll the viewport by entire pages worth of content using `SetConsoleWindowInfo` - see #15932 * The screen and scrollbars update immediately ✅ (cherry picked from commit 7a1b6f9) Service-Card-Id: 91152167 Service-Version: 1.19
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
81b7e54 caused a regression in
SetConsoleWindowInfoand any otherfunction that used the
WriteToScreenhelper. This is because itassumes that it can place the viewport anywhere randomly and it was
written at a time where
TriggerScrolldidn't exist yet (there wasno need for that (also not today, but that's being worked on)).
Caching the viewport meant that
WriteToScreen's call toTriggerRedrawwould pick up the viewport from the last renderedframe, which would cause the intersection of both to be potentially
empty and nothing to be drawn on the screen.
This commit reverts 81b7e54 as I found that it has no or negligible
impact on performance at this point, likely due to the overall
vastly better performance of conhost nowadays.
Closes #15932
Validation Steps Performed
SetConsoleWindowInfo- see Conhost window is not refreshed after software scroll #15932