Skip to content

Maximize before Activate causes top edge glitch for Windows with ExtendsContentIntoTitleBar set to true. #268

@riyasy

Description

@riyasy

If we call Maximize before Activate (I am not sure whether it is legal),
the window appears slightly expanded and then settles into the maximized rect. This causes a visual glitch.

This only happens if ExtendsContentIntoTitleBar is true.

using Microsoft.UI.Xaml;
using WinUIEx;

namespace WinUiMaximizedTest;

public partial class App : Application
{
    private MainWindow? _window;

    public App() => InitializeComponent();

    protected override void OnLaunched(LaunchActivatedEventArgs args)
    {
        _window = new MainWindow();
        _window.Maximize();
        _window.Activate();
    }
}
using Microsoft.UI;
using Microsoft.UI.Xaml;

namespace WinUiMaximizedTest;

public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        var titleBar = AppWindow.TitleBar;
        titleBar.ExtendsContentIntoTitleBar = true;
        titleBar.ButtonBackgroundColor = Colors.Transparent;
        titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
    }
}

Observe the top most portion. Video from one of my users.

02.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions