dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.27k stars 1.76k forks source link

[regression/8.0.0] [Windows]Shell flyout menu missing 😨 when full screen #18611

Open BaY1251 opened 1 year ago

BaY1251 commented 1 year ago

Description

I cannot hide the title bar under any circumstances, it was possible before MAUI8.0. There are no elements except for the Shell flyout menu

I tried appWindow.SetPresenter(AppWindowPresenterKind.FullScreen);

AND #17041

presenter.SetBorderAndTitleBar(false, false);
presenter.Maximize();;

AND #15142

presenter.IsMaximizable = false;
presenter.IsResizable = false;
presenter.IsMinimizable = false;
presenter.SetBorderAndTitleBar(true, false);

ALL CAN NOT completely hide the TitleBar

fullscreen

Steps to Reproduce

Download https://github.com/BaY1251/MauiDebug.git Open /ANR/ANR.sln to compile and generate a project Run

Link to public reproduction project repository

https://github.com/BaY1251/MauiDebug.git

Version with bug

8.0.0-rc.2.9530

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows10-22H2 net8.0-windows10.0.19041.0

Did you find any workaround?

No response

Relevant log output

No response

Foda commented 1 year ago

Hello! After testing locally a bit I've got a work-around for you. You'll just need to make sure the window is loaded first before setting it to be fullscreen. It seems to be caused by the NavigationView style in WinUI setting the top-margin to 32 when the titlebar is hidden (???)

In your example, add the following to CreateMauiApp in MauiProgram.cs before builder.Build():

#if WINDOWS
        builder.ConfigureLifecycleEvents(events =>
        {
            events.AddWindows(windows =>
                windows.OnWindowCreated(window =>
                {
                    var presenter = window?.AppWindow.Presenter;
                    switch (presenter)
                    {
                        case Microsoft.UI.Windowing.OverlappedPresenter overlappedPresenter:
                            overlappedPresenter.SetBorderAndTitleBar(false, false);
                            overlappedPresenter.Maximize();
                            break;
                    }
                }));
        });
#endif

Then, just remove the Microsoft.Maui.Handlers.WindowHandler.Mapper.AppendToMapping code in Windows/App.xaml.cs.

BaY1251 commented 1 year ago

@Foda TitleBar is indeed hidden, but the Shell flyout menu is also missing 😨. Then how to Open flyout?

bar

BaY1251 commented 1 year ago

Shell.flyout.menu can show in Shell.TitleView? style may like Android

bar

RoiChen001 commented 8 months ago

I can't repro this issue on the latest 17.10 Preview1.

BaY1251 commented 8 months ago

Have you confirmed "Shell flyout menu missing, when full screen"?
Unable to open the flyout when full screen

BaY1251 commented 8 months ago

Have you confirmed "Shell flyout menu missing, when full screen"?
Unable to open the flyout when full screen

RoiChen001 commented 8 months ago

@BaY1251 Sorry for the mistake. I can repro it now.