-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Prevent conhost scrollbar overlapping content #14329
Conversation
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.
sure, seems sensible to me!
Just to confirm, this will cause a console window to grow by one scrollbar's width when (1) in TerminalScrolling mode and (2) it gains one more line than fits in the original viewport? Will this cause a resize event if the console is maximized while this happens? |
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.
(Blocking for question)
No. The only time the size changes is when you switch the configuration from a layout that could potentially need a scrollbar (i.e. the buffer height is larger than the window height), and one that would not (i.e. the buffer height and window height are equal). This is the way it has always worked. If you are in the former configuration, there will already be space allocated for the scrollbar, but it now won't be visible - there'll be a gap along the right hand border where it's expected to appear. Once you gain more content than can fit in that window, the scrollbar becomes visible, but nothing needs to be resized because we've already made space for it. If you are in the latter configuration, there is no space allocated for the scrollbar, but it should never be shown now, so that's not an issue either. The only thing we're changing here is the visibility of the scrollbar, which you can think of as an overlay. Whether it's visible or not doesn't affect the size of the window in any way. Does that make sense? |
(Sorry, I was on vacation!) OH. Damn. That makes perfect sense. Thanks for explaining it. 😄 |
Hello @lhecker! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Prior to this PR, the conhost vertical scrollbar would be forced to be
visible whenever the "Disable Scroll-Forward" option was set. It was
assumed that it would be needed as soon as the current viewport was
filled, so it was better to start off visible and disabled.
When the viewport height and buffer height are the same, though, the
scrollbar is never needed, and conhost compensates for that by making
the window narrower. But since we were still forcing the scrollbar to be
visible, that would result in it overlapping content in the rightmost
columns.
This PR attempts to fix that issue by simply leaving the scrollbar to
decide the visibility itself. This is perhaps not as aesthetically
pleasing when it starts off hidden and then later becomes visible, but
that seems better than having it overlap the content.
I've manually confirmed this fixes the problem reported in issue #2449.
Closes #2449