Repository navigation
Closed
Labels
Area-UserInterfaceIssues pertaining to the user interface of the Console or TerminalIssues pertaining to the user interface of the Console or TerminalIssue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.The new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.
Milestone
Description
This is work that's following on from work that's being done for #1625.
I'm pulling the code for updating the drag region out of NonClientIslandWindow::OnSize into its own method. Unfortunately, both these methods need to do the following block of work:
const auto windowRect = GetWindowRect();
const auto width = windowRect.right - windowRect.left;
const auto height = windowRect.bottom - windowRect.top;
const auto scale = GetCurrentDpiScale();
const auto dpi = ::GetDpiForWindow(_window.get());
const auto dragY = ::GetSystemMetricsForDpi(SM_CYDRAG, dpi);
const auto dragX = ::GetSystemMetricsForDpi(SM_CXDRAG, dpi);
// If we're maximized, we don't want to use the frame as our margins,
// instead we want to use the margins from the maximization. If we included
// the left&right sides of the frame in this calculation while maximized,
// you' have a few pixels of the window border on the sides while maximized,
// which most apps do not have.
const auto bordersWidth = _isMaximized ?
(_maximizedMargins.cxLeftWidth + _maximizedMargins.cxRightWidth) :
(dragX * 2);
const auto bordersHeight = _isMaximized ?
(_maximizedMargins.cyBottomHeight + _maximizedMargins.cyTopHeight) :
(dragY * 2);
const auto windowsWidth = width - bordersWidth;
const auto windowsHeight = height - bordersHeight;
const auto xPos = _isMaximized ? _maximizedMargins.cxLeftWidth : dragX;
const auto yPos = _isMaximized ? _maximizedMargins.cyTopHeight : dragY;
const auto dragBarRect = GetDragAreaRect();
const auto nonClientHeight = dragBarRect.bottom - dragBarRect.top;Doing this twice is clearly ridiculous, and more likely than not, wrong.
I'm thinking that on the resize, we could probably just cache some of these values. I think this will also important for dealing with maximizing, cause I think know the maximize borders are wrong on non-primary displays.
Metadata
Metadata
Assignees
Labels
Area-UserInterfaceIssues pertaining to the user interface of the Console or TerminalIssues pertaining to the user interface of the Console or TerminalIssue-TaskIt's a feature request, but it doesn't really need a major design.It's a feature request, but it doesn't really need a major design.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsProduct-TerminalThe new Windows Terminal.The new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.
Activity
Insomniak47 commentedon Jul 13, 2019
Just wanted to pop in and confirm that your intuition re: Maximizing on non-primary windows is correct:
I've got a portrait mode 1920*1080 monitor and when I maximize on it I lose the first character of my terminal prompt line
Instead of
C:\Users\Insomniakit's
:\Users\InsomniakLocal user mitigation is just to not maximize or do a half screen maximize and then just drag it out.
I think that this is what you were mentioning but if that isn't the case let me know and I'll file a separate issue.
DHowett-MSFT commentedon Jul 14, 2019
That one is known and fixed in the dev build 😄
Use standard 1px window borders on NC Island Window (#3394)