titlebar customization and AppWindowPresenterKind.FullScreen crashes winforms app
Describe the bug
when trying to enter full screen using the API, i keep experiencing crash on my packaged winforms app (with windowsappsdk nuget installed).
other modes such as Default, CompactOverlay, etc work just fine.
Steps to reproduce the bug
- create winforms app
- setup to use windows app sdk
- create msix installer project and reference the winforms app
- create a button
// in the form.
AppWindow GetAppWindow()
{
return AppWindow.GetFromWindowId(
Win32Interop.GetWindowIdFromWindow(this.Handle));
}
// in the button.
GetAppWindow().SetPresenter(AppWindowPresenterKind.FullScreen);
Expected behavior
no crash
Screenshots
No response
NuGet package version
Windows App SDK 1.6.6: 1.6.250228001
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 24H2 (22621, October 2024 Update)
IDE
Visual Studio 2022
Additional context
No response
ok after hours of finding out the problem i finally got the true trigger of this bug. make sure to set the titlebar color to something custom and it will crash on fullscreen.
reproducible on sample winforms app both on unpackaged and packaged mode.
https://github.com/user-attachments/assets/92f97a3b-6252-4a06-aeb1-d296519ca841
seems to work after upgrading the winappsdk nuget to 1.7 but i still can see a minor glitch when entering full screen if the titlebar is customized.
i think i will leave this open until the glitch is fixed.