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

[regression/8.0.0-preview.4.8333] Full-screening a window no longer removes its title-bar #15676

Closed
aidan-bailey opened this issue Jun 15, 2023 · 2 comments · Fixed by #17041
Closed
Assignees
Labels
area-controls-window Window fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373! platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)
Milestone

Comments

@aidan-bailey
Copy link

Description

When fullscreening a window in 8.0.0-preview.4, an empty title-bar remains, e.g.
image

On 7, this behaves appropriately, e.g.
image

Steps to Reproduce

  1. Create a new MAUI App template (8.0.0 preview).
  2. Replace MainPage = new Shell(); with MainPage = new MainPage(); in App.xaml.cs.
  3. Add the following code to the CreateMauiApp method in MauiProgram.cs:
#if WINDOWS
        builder.ConfigureLifecycleEvents(events => {
            // Make sure to add "using Microsoft.Maui.LifecycleEvents;" in the top of the file 
            events.AddWindows(windowsLifecycleBuilder => {
                windowsLifecycleBuilder.OnWindowCreated(window => {
                    window.ExtendsContentIntoTitleBar = false;
                });
            });
        });
#endif
  1. Replace the content of OnCounterClicked in MainPage.xaml.cs with:
#if WINDOWS
        var window = Window.Handler.PlatformView as MauiWinUIWindow;
        var handle = WinRT.Interop.WindowNative.GetWindowHandle(window);
        var id = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(handle);
        var appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(id);

        switch (appWindow.Presenter) {
            case Microsoft.UI.Windowing.OverlappedPresenter overlappedPresenter:
                if (overlappedPresenter.State == Microsoft.UI.Windowing.OverlappedPresenterState.Maximized) {
                    overlappedPresenter.SetBorderAndTitleBar(true, true);
                    overlappedPresenter.Restore();
                } else {
                    overlappedPresenter.SetBorderAndTitleBar(false, false);
                    overlappedPresenter.Maximize();
                }

                break;
        }
#endif
  1. Change the background colour of the ScrollView in MainPage.xaml so you can see the background of the page clearer:
...
<ScrollView BackgroundColor="Red">
...
  1. Launch app and click the button to see the title-bar still existing with just the top-right buttons disappearing.

Link to public reproduction project repository

https://github.com/aidanjbailey/Maui8FullscreenTest

Version with bug

8.0.0-preview.4.8333

Last version that worked well

7.0.86

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.19041.0

Did you find any workaround?

I have not been able to find a workaround.

Relevant log output

No response

@aidan-bailey aidan-bailey added the t/bug Something isn't working label Jun 15, 2023
@aidan-bailey aidan-bailey changed the title Full-screening a window no longer removes its title-bar. Full-screening a window no longer removes its title-bar Jun 15, 2023
@Eilon Eilon added the legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) label Jun 15, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 21, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.7.0 Preview 4.0. Repro on Windows 11 .NET 8 with below Project:
15676.zip

@samhouts samhouts changed the title Full-screening a window no longer removes its title-bar [regression/8.0.0-preview.4.8333] Full-screening a window no longer removes its title-bar Aug 3, 2023
@samhouts samhouts added this to the .NET 8 GA milestone Aug 3, 2023
@samhouts samhouts added the i/regression This issue described a confirmed regression on a currently supported version label Aug 3, 2023
@Foda Foda self-assigned this Aug 23, 2023
@samhouts samhouts added potential-regression This issue described a possible regression on a currently supported version., verification pending and removed i/regression This issue described a confirmed regression on a currently supported version labels Sep 5, 2023
@samhouts
Copy link
Member

samhouts commented Sep 7, 2023

I can confirm that the titlebar is different between NET 7 and NET 8 (in NET 7, the buttons are still there), but I did not ever see the titlebar disappear in any version, so it is unclear if this is a regression and/or when the regression occurred.

@samhouts samhouts added the fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373! label Oct 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 9, 2023
@Eilon Eilon added t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK) area-controls-window Window and removed legacy-area-desktop Windows / WinUI / Project Reunion & Mac Catalyst / macOS specifics (Menus & other Controls)) labels May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-window Window fixed-in-8.0.0-rc.2.9373 Look for this fix in 8.0.0-rc.2.9373! platform/windows 🪟 potential-regression This issue described a possible regression on a currently supported version., verification pending s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working t/desktop The issue relates to desktop scenarios (MacOS/MacCatalyst/Windows/WinUI/WinAppSDK)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants