Skip to content

TitleBar buttons are scaled very small at a resolution of 4K (288 DPI) #677

Description

@Case-Closed-X

Description

WPF Gallery Preview close button doesn’t have corners, the close button will be displayed as shown in the screenshot at a resolution of 3840 * 2160 (Set display scaling to 300% which results in 288 DPI).

Another issue is that the minimize, maximize, and close buttons are scaled very small (It also exists in Win32 and WinForms applications) at a resolution of 3840 * 2160 (300% scaling -> 288 DPI).

Actual behavior

Image

Expected behavior

Image

Reproduction Steps

Launch WPF Gallery Preview, change display resolution to 3840 * 2160, and set display scaling to 300% which results in 288 DPI.

Without using WPF Fluent theme

By the way, even without using WPF Fluent theme (.net 9), the TitleBar buttons are still scaled very small (It also exists in Win32 and WinForms applications) at a resolution of 3840 * 2160 (300% scaling -> 288 DPI). Can this problem be solved?

From the left: WPF, WinForms, Win32 (All small buttons) & WinUI 3 (Normal buttons):
Image

Image

Below are the test screenshots for 336 DPI (Small buttons) and 216 DPI (Normal buttons) configurations.

350% scaling -> 336 DPI: Windows Explorer (Left) & Microsoft Store (Right)
image

225% scaling -> 216 DPI: Windows Explorer (Left) & Microsoft Store (Right)
image

Activity

  1. changed the title [-]WPF Gallery Preview close button doesn’t have corners[/-] [+]TitleBar buttons are scaled very small at a resolution of 4K[/+] on Dec 17, 2024
  2. dipeshmsft commented on Mar 19, 2025

    @dipeshmsft
    Member

    X (@Case-Closed-X) this seems more like a WPF issue as compared to WPF Gallery. If this is a generic issue we can move this issue to dotnet/wpf repository.

  3. Case-Closed-X commented on Mar 22, 2025

    @Case-Closed-X
    Author

    @Case-Closed-X this seems more like a WPF issue as compared to WPF Gallery. If this is a generic issue we can move this issue to dotnet/wpf repository.

    I... I have no idea. I've noticed that this isn't an issue unique to WPF. It also exists in Win32 and WinForms applications, and has persisted for over a decade. Completely fixing this problem would likely require modifications to the underlying codes. Addressing it only in the WPF Win11 theme could be significantly easier.

    From the left: WPF, WinForms, Win32 (All small buttons at 4K resolution) & WinUI (Normal buttons)
    Image

    Image

  4. dipeshmsft commented on Mar 24, 2025

    @dipeshmsft
    Member

    X (@Case-Closed-X), thanks for the above information. Given this, I will move this issue to dotnet/wpf repo.

    Addressing it only in the WPF Win11 theme could be significantly easier.

    I don't think we can fix this problem in Fluent theme as well however, we can fix this for WPF Gallery maybe, by using scaling / relative sizing. I will give it a try.

  5. Case-Closed-X commented on Mar 24, 2025

    @Case-Closed-X
    Author

    Dipesh Kumar (@dipeshmsft), thank you! May the source be with you!

  6. changed the title [-]TitleBar buttons are scaled very small at a resolution of 4K[/-] [+]TitleBar buttons are scaled very small at a resolution of 4K (288 DPI)[/+] on Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions