Skip to content
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 close button does not fill with main window #9934

Open
dinhcongduy opened this issue Aug 30, 2024 · 5 comments
Open

Window close button does not fill with main window #9934

dinhcongduy opened this issue Aug 30, 2024 · 5 comments
Labels
area-AppWindow area-TitleBar Issues related to custom window title bars. bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team

Comments

@dinhcongduy
Copy link

Describe the bug

Window close button have padding right in main window

Steps to reproduce the bug

_mainWindow.ExtendsContentIntoTitleBar = true
_mainWindow.SetAdjustBar(GetCurrentTheme());

Expected behavior

Remove right padding for Window Close button

Screenshots

Untitled

NuGet package version

WinUI 3 - Windows App SDK 1.5.6: 1.5.240802000

Windows version

Windows 10 (21H1): Build 19043

Additional context

No response

@dinhcongduy dinhcongduy added the bug Something isn't working label Aug 30, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 30, 2024
@castorix
Copy link

On Windows 10 22H2, on "normal" Desktop/UWP apps, I have borders at top + right
For example, with Notepad :

image

@4OTbIPE
Copy link

4OTbIPE commented Aug 30, 2024

It's because of this

@castorix
Copy link

castorix commented Aug 31, 2024

With Windows App SDK 1.5.24, it can be fixed by repositioning the "ReunionWindowingCaptionControls" window
(subclassing + WM_WINDOWPOSCHANGING)
(I added a yellow border to AppTitleBar to check the rectangle) :

image

@michelgerritse
Copy link

michelgerritse commented Sep 3, 2024

With Windows App SDK 1.5.24, it can be fixed by repositioning the "ReunionWindowingCaptionControls" window (subclassing + WM_WINDOWPOSCHANGING) (I added a yellow border to AppTitleBar to check the rectangle) :

image

I can confirm this fixes the offset by 1 error with the caption buttons on Windows 10. I don't have Windows 11 so I was not able to test the (original) behavior on that OS version. In combination with DWM extending the top border of the main/parent window by 2 you will get rid of most, if not all, graphical issues with the caption buttons (besides the wrong colors, but we have an API to fix this). The only issue that I'm aware of is the missing OS provided tooltips for the minimize and maximize/restore caption buttons (the close tooltip does show).

I noticed something interesting while subclassing the ReunionWindowingCaptionControls class child window:
The parent will never get a WM_PARENTNOTIFY message when this child is about to be destroyed. This could be intentional, or a bug, but it should be common practice to destroy all your child windows before you destroy the parent.

@castorix
Copy link

castorix commented Sep 3, 2024

And I did not test 1.6 experimental but they say there is a new control https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/experimental-channel#new-titlebar-control
with
Note

The new TitleBar control we released in 1.6-experimental1 is not yet available in non-experimental builds of 1.6 to allow more time to evaluate and respond to community feedback. We received a lot of great input here and want to make sure we take the time needed to address it.

@codendone codendone added area-AppWindow team-CompInput Issue for IXP (Composition, Input) team area-TitleBar Issues related to custom window title bars. and removed needs-triage Issue needs to be triaged by the area owners labels Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-AppWindow area-TitleBar Issues related to custom window title bars. bug Something isn't working team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

5 participants