-
Notifications
You must be signed in to change notification settings - Fork 693
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
Window size not correctly applied #10204
Comments
It is because of DWM |
If you want the client area to be set to the size specified, remember that AppWindow has the ResizeClient member. This will set the client area to the size specified by taking the styles into account. Since the screenshot of your code shows that you are using ExtendContentIntoTitleBar, then what you are measuring there is the client area. Resize sets the window size and ResizeClient sets the window size to give a specified client size. |
Oh i didn't know about |
The implementation of the title bar customisation functionality is shared with AppWindow in current versions. This means that you should be able to go through AppWindow to get an AppWindowTitleBar instance. AppWindowTitleBar has a Height property which reports the height of the title bar. |
Thank you. Using |
Describe the bug
When specifiying the Window size via
AppWindow.Resize(new SizeInt32(800, 450))
the actual window size appears to be little bit smaller than what is requested:One Idea of @dotMorten was (dotMorten/WinUIEx#200) that setting the window dimension is "taking the drop shadow into account". Is that true? If so how to get a window of exactly the size specified?
dotMorten/WinUIEx#200
Steps to reproduce the bug
Expected behavior
The window size to be exact to the requested size minus border
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response
The text was updated successfully, but these errors were encountered: