Bottom area of window is getting hidden behind task bar when maximizing the Window Provided Title bar and buttons are hidden.
AkilanRagavaswamy opened this issue · 1 comments
Describe the bug
Having a winUi3 application which doesn't have title bar. i.e, Content will be extended to the title bar and Close, minimize, maximize buttons will be hidden. When the window is minimized in code behind, and when it is bought back to active, the bottom area of window is getting hidden behind task bar.
Similarly, when app is opened in full screen on first launch the taskbar is hidden. But when minimized and maximized again, it is getting hidden in behind.
Windows App SDK Version : 1.6.241114003
Windows.SDK.BuildTools : 10.0.26100.1742
Visual Studio version : 17.12.3
Steps to reproduce the bug
- Create a blank packaged winui3 application.
- In App.xaml.cs, OnLaunched method, add the below code after activating the window,
AppWindow appWindow = GetAppWindowForCurrentWindow(); appWindow.SetPresenter(AppWindowPresenterKind.FullScreen); if (appWindow.Presenter is OverlappedPresenter p) { p.Maximize(); p.SetBorderAndTitleBar(false, false); appWindow.TitleBar.ExtendsContentIntoTitleBar = true; }
- In MainWindow constructor, add the below code,
this.SystemBackdrop = new DesktopAcrylicBackdrop(); this.SetTitleBar(null); this.AppWindow.TitleBar.IconShowOptions = IconShowOptions.HideIconAndSystemMenu; this.ExtendsContentIntoTitleBar = true; this.AppWindow.TitleBar.ExtendsContentIntoTitleBar = true;
- In myButton_Click method, add the below snippet to minimize the application.
IntPtr hWnd = WindowNative.GetWindowHandle(this); WindowId myWndId = Win32Interop.GetWindowIdFromWindow(hWnd); AppWindow appWindow = AppWindow.GetFromWindowId(myWndId); appWindow.SetPresenter(AppWindowPresenterKind.Overlapped); if (appWindow.Presenter is OverlappedPresenter p) { p.Maximize(); p.Minimize(); p.SetBorderAndTitleBar(false, false); }
- Start the app, after application started, minimize and then open the app from task bar
Expected behavior
The bottom part of the application should not hide behind the task bar.
Screenshots
NuGet package version
None
Windows version
Windows 11 Pro
22631.4602
Additional context
Note: This is working fine when the title bar and titlebar buttons are visible