[PR #1898] [MERGED] Don't NCPAINT our window, PAINT our window #24698

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/1898
Author: @zadjii-msft
Created: 7/9/2019
Status: ✅ Merged
Merged: 7/12/2019
Merged by: @zadjii-msft

Base: master ← Head: dev/migrie/f/1625-less-round-more-shadow


📝 Commits (7)

  • 15a1f48 This definitely works for getting shadow, pointy corners back
  • 0bc9969 The window style was not important
  • bf239b6 Still getting a black xaml islands area (the HRGN) when we switch to high DPI
  • 22e1023 I don't know if this affects anything.
  • aad9f56 heyo this works.
  • 5fd4191 Add more comments and cleanup
  • 9040940 Some PR nits, fix the titlebar painting on maximize

📊 Changes

3 files changed (+85 additions, -21 deletions)

View changed files

📝 src/cascadia/WindowsTerminal/BaseWindow.h (+1 -0)
📝 src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp (+83 -21)
📝 src/cascadia/WindowsTerminal/NonClientIslandWindow.h (+1 -0)

📄 Description

Summary of the Pull Request

Fixes the round corners and lack of shadow on the window introduced in #929.
image

References

This introduces the problem discussed in #1897

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • If we handle WM_NCPAINT, we don't get shadows. We also get the legacy rounded top window corners, because of some kernel insanity. The whole point of DwmExtendFrameIntoClientArea is that we can just PAINT the entire window, instead of trying to do NC_PAINT tricks. So, we need to move the entire NCPAINT we had into PAINT.
  • We also need to remove the margins we were setting. If we leave a top margin, the system caption buttons will try and draw into that area. Since we don't want those, we need to make sure the top margin is 0, so they have no space to draw into.
  • I also split out the DragSizeChanged handler from OnSize. I don't know why, but having it inside OnSize would cause the xaml island content to go black when moving the window from a secondary normal DPI display back to a high DPI primary display.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/1898 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 7/9/2019 **Status:** ✅ Merged **Merged:** 7/12/2019 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `master` ← **Head:** `dev/migrie/f/1625-less-round-more-shadow` --- ### 📝 Commits (7) - [`15a1f48`](https://github.com/microsoft/terminal/commit/15a1f482548db10cf49a0702b6e8b912241596e8) This definitely works for getting shadow, pointy corners back - [`0bc9969`](https://github.com/microsoft/terminal/commit/0bc9969361c3d583cf0ab34d2f7e95d4aafbf347) The window style was _not_ important - [`bf239b6`](https://github.com/microsoft/terminal/commit/bf239b6de055fa2719367529590264443bc9a0b4) Still getting a black xaml islands area (the HRGN) when we switch to high DPI - [`22e1023`](https://github.com/microsoft/terminal/commit/22e102386b29c537acff8f95d8606255dd7d1288) I don't know if this affects anything. - [`aad9f56`](https://github.com/microsoft/terminal/commit/aad9f56d83cf2a25fcea680016797a6f982d6cc5) heyo this works. - [`5fd4191`](https://github.com/microsoft/terminal/commit/5fd41919e94e3e9b14836c29eaab4751f9bffa03) Add more comments and cleanup - [`9040940`](https://github.com/microsoft/terminal/commit/90409409116bde04e69b86c3e857fd38507856e9) Some PR nits, fix the titlebar painting on maximize ### 📊 Changes **3 files changed** (+85 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/WindowsTerminal/BaseWindow.h` (+1 -0) 📝 `src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp` (+83 -21) 📝 `src/cascadia/WindowsTerminal/NonClientIslandWindow.h` (+1 -0) </details> ### 📄 Description <!-- 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 Fixes the round corners and lack of shadow on the window introduced in #929. ![image](https://user-images.githubusercontent.com/18356694/60923472-931b9b00-a264-11e9-97a5-7b36f0dbfde2.png) <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References This introduces the problem discussed in #1897 <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Touches some #1625 bits. Closes #872 * [x] you better believe I work here * [ ] Tests make me cry * [x] Requires documentation to be updated - no <!-- 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 * If we handle `WM_NCPAINT`, we _don't_ get shadows. We also get the legacy rounded top window corners, because of some kernel insanity. The whole point of `DwmExtendFrameIntoClientArea` is that we can just `PAINT` the entire window, instead of trying to do `NC_PAINT` tricks. So, we need to move the entire NCPAINT we had into PAINT. * We also need to remove the margins we were setting. If we leave a top margin, the system caption buttons will try and draw into that area. Since we don't want those, we need to make sure the top margin is 0, so they have no space to draw into. * I also split out the DragSizeChanged handler from OnSize. I don't know why, but having it inside OnSize would cause the xaml island content to go black when moving the window from a secondary normal DPI display back to a high DPI primary display. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:04:50 +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#24698