microsoft / microsoft/microsoft-ui-xaml

Bug title - Color change in apptitle change breaking the font size in 175% display scale

Open
#10,963 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area-TitleBar bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Which version of the app?

WinUI 3 Gallery

### Description

Hi, I am trying to change the title text and the apptitle color without using a custom apptitle.
However, when I change any titleBar property, I've got the wrong title font size only for 175% display scale.

public MainWindow()
{
this.InitializeComponent();

var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
var windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);
var appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);

appWindow.Title = "TitleTest";
appWindow.TitleBar.BackgroundColor = Colors.Gray; //When the background is set, the app changes the 175%DisplayScale title font size to the 150%DisplayScale title font size.
}

Is there a way to change only the title and the titlebar background without using a custom titlebar to avoid this?

Image

### Screenshots

_No response_

### Windows version

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided WinUI 3 Gallery reproduction using AppWindow.TitleBar.BackgroundColor, and compare the title-bar font at 150% and 175% display scaling. Trace the title-bar scaling behavior from the AppWindow and title-bar APIs; done means changing the title or background preserves the correct 175% font size without a custom title bar.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.