[PR #3394] Use standard 1px window borders on NC Island Window #25346

Open
opened 2026-01-31 09:08:55 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/3394

State: closed
Merged: Yes


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:
frame

Light mode, color in title bar enabled:
frame color

Dark mode, color in title bar disabled:
frame dark

Dark mode, color in title bar enabled:
frame dark color

High contrast mode (with Settings app on right to compare):
high contrast

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

  • Closes #3064, closes #1307, closes #3136, closes #1897, closes #3222, closes #1859, closes #2268 and maybe more?
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

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 using DwmExtendFrameIntoClientArea 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

**Original Pull Request:** https://github.com/microsoft/terminal/pull/3394 **State:** closed **Merged:** Yes --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## 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: ![frame](https://user-images.githubusercontent.com/56923875/67972211-87d2ed80-fc0e-11e9-8a89-d0a218a6fc36.png) Light mode, color in title bar enabled: ![frame color](https://user-images.githubusercontent.com/56923875/67972645-63c3dc00-fc0f-11e9-9218-f229cdf7dfa7.png) Dark mode, color in title bar disabled: ![frame dark](https://user-images.githubusercontent.com/56923875/67972668-6cb4ad80-fc0f-11e9-943e-3b5bd9f5079e.png) Dark mode, color in title bar enabled: ![frame dark color](https://user-images.githubusercontent.com/56923875/67972679-72aa8e80-fc0f-11e9-9da0-8308a85359a5.png) High contrast mode (with Settings app on right to compare): ![high contrast](https://user-images.githubusercontent.com/56923875/68075465-7b829800-fda8-11e9-8427-7069d636d666.png) 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. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #3064, closes #1307, closes #3136, closes #1897, closes #3222, closes #1859, closes #2268 and maybe more? * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## 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 using `DwmExtendFrameIntoClientArea` 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. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
claunia added the pull-request label 2026-01-31 09:08:55 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25346