Skip to content

Title bar is messed up in window preview when minimized #11941

Description

@benstevens48

Describe the bug

In an empty WinUI app, set

AppWindow.TitleBar.BackgroundColor = Colors.Black;
AppWindow.TitleBar.ButtonBackgroundColor = Colors.Black;

Minimize the window. Hover over the taskbar icon then hover over the small preview image to get a large preview of the window. At this point the title bar is broken in the following ways.

  • The buttons have moved to the left hand size
  • The background of the title bar is light gray
  • The background of the buttons is white

This is corrected when the window is restored.

It seems like maybe the title bar tries to resize itself in response to the size change on minimize: this would account for the buttons being on the left, but not sure about the color change. Anyway, the title bar should avoid changing on window minimize.

Why is this important?

Unprofessional user experience

Steps to reproduce the bug

See description. Minimal code:

using Microsoft.UI;
using Microsoft.UI.Xaml;

namespace TestMinimizeHover {
    public sealed partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            AppWindow.TitleBar.BackgroundColor = Colors.Black;
            AppWindow.TitleBar.ButtonBackgroundColor = Colors.Black;
        }
    }
}

Actual behavior

See description

Expected behavior

The title bar rendering/layout should not break when the window is minimized.

Screenshots

No response

NuGet package version

2.5.1

Windows version

Windows 11 (25H2): Build 26200

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageIssue needs to be triaged by the area owners

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions