-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Use standard 1px window borders on NC Island Window #3394
Conversation
With this change there is no resize handle directly on top of the tab row. This is the same behavior as classic Edge for reference (but it doesn't mean that it's good). This might be fixed by adding space on top of the tab row and excluding it from the XAML island region. |
I don't know enough about the non-client area and XAML stuff to go through this. @DHowett-MSFT is the non-client expert and @zadjii-msft is the current UI king. So I'll let them stab first. |
bravo! |
🎉 Handy links: |
So...any way to color this new 1px border? I don't think there is a setting in Windows to color inactive window borders differently anymore, is there? |
I couldn't find more details about this here, so does this mean the white border will be fixed with a new release or does the fix need to come from Windows, i.e. we would have to get 20H1 for the fix? |
@Stanzilla The border behaves the same way as other windows. When it is active it will be either the accent color that you chose in Windows Settings if "Show accent color on the following surfaces -> Title bars and windows borders" is checked or a gray color otherwise. When it is inactive, it will always be gray. I don't think that there is a setting to color inactive window borders in Windows. @adrianghc 20H1 changed the way to make the border dark. I think it is possible to detect if 20H1 is running and use the new way and if it's older than 20H1, use the old way to make the border dark so it could be fixed without waiting for 20H1 if this is done. |
Well yeah, I don't really want to use my accent color on every window, was just wondering if there is a way to overwrite. But if that is black in 20H1 I'm okay with that |
Thanks @greg904, so it sounds like its not a stable solution yet correct? Wondering if it might be best to sit tight a little longer until a new version of WT fixes this, or if it's worthwhile to attempt your solution in #4577 |
If you run the fix:
If you wait:
BTW, just to be clear: And if you enable it, you will have a border but now it will be blue: So there still is a blue border but it is just like other apps: |
Summary of the Pull Request
I put the standard Windows window borders on the Windows Terminal window (can you read that?).
(It's only on the left, bottom and right though, on the top I had to use a hack because of the title bar)
Light mode, color in title bar disabled:
Light mode, color in title bar enabled:
Dark mode, color in title bar disabled:
Dark mode, color in title bar enabled:
High contrast mode (with Settings app on right to compare):
Note: the title bar should probably be purple like in Win32 apps but it isn't either in the UWP apps (Settings, classic Edge, …) so I don't really know.
References
PR Checklist
Detailed Description of the Pull Request / Additional comments
We take the standard window frame except that we remove the top part (see
NonClientIslandWindow::_OnNcCalcSize
), then we put little 1 pixel wide top border back in the client area usingDwmExtendFrameIntoClientArea
and then we put the XAML island and the drag bar on top.Most of this PR is comments to explain how the code works and also removing complex code that was needed to handle the weird cases when the borders were custom.
I've also refactored a little bit the
NonClientIslandWindow
class.Validation Steps Performed