-
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
Don't NCPAINT our window, PAINT our window #1898
Conversation
Don't do anything in NCPAINT. If you do, you have to do everything. But the whole point of DwmExtendFrameIntoClientArea is to let you paint the NC area in your normal paint. So just do that dummy. * This doesn't transition across monitors. * This has a window style change I think is wrong. * I'm not sure the margins change is important.
I'm not entirely sure why. But if we only update the titlebar drag region when that actually changes, it's a _lot_ smoother. I'm not super happy with the duplicated work in _UpdateDragRegion and OnSize, but checking this in in case I can't figure that out.
Where are the resize handles here? Are they outside, on the shadow or inside, in the white border? |
They are exactly on the border, unfortunately. No worse than before. I might be able to play with our NCHITTEST code - maybe we're clipping the resize handle area, though no promises. |
@DHowett-MSFT For the record, I fixed the titlebar maximize thing in 9040940 (what a sha) |
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.
I love it.
@@ -113,8 +118,53 @@ void NonClientIslandWindow::OnSize(const UINT width, const UINT height) | |||
_rootGrid.Arrange(finalRect); | |||
} | |||
|
|||
// I'm not sure that HWND_BOTTOM is any different than HWND_TOP for us. |
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.
I don't understand what this comment is supposed to mean.
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.
Oh mainly just that both those values do the same thing, which doesn't really make sense, so there's not really a reason one was picked over the other
* This definitely works for getting shadow, pointy corners back Don't do anything in NCPAINT. If you do, you have to do everything. But the whole point of DwmExtendFrameIntoClientArea is to let you paint the NC area in your normal paint. So just do that dummy. * This doesn't transition across monitors. * This has a window style change I think is wrong. * I'm not sure the margins change is important. * The window style was _not_ important * Still getting a black xaml islands area (the HRGN) when we switch to high DPI * I don't know if this affects anything. * heyo this works. I'm not entirely sure why. But if we only update the titlebar drag region when that actually changes, it's a _lot_ smoother. I'm not super happy with the duplicated work in _UpdateDragRegion and OnSize, but checking this in in case I can't figure that out. * Add more comments and cleanup * Some PR nits, fix the titlebar painting on maximize
🎉 Handy links: |
Summary of the Pull Request
Fixes the round corners and lack of shadow on the window introduced in #929.
References
This introduces the problem discussed in #1897
PR Checklist
Detailed Description of the Pull Request / Additional comments
WM_NCPAINT
, we don't get shadows. We also get the legacy rounded top window corners, because of some kernel insanity. The whole point ofDwmExtendFrameIntoClientArea
is that we can justPAINT
the entire window, instead of trying to doNC_PAINT
tricks. So, we need to move the entire NCPAINT we had into PAINT.