Skip to content

Better control over window drawn decorations #21178

Description

@MrJul

Is your feature request related to a problem? Please describe.

When ExtendClientAreaToDecorationsHint == true, WindowDrawnDecorations are used.

However, the decorations in v12 have more elements than in v11 (when WindowDecorations == Full), notably a full-screen button and a visible title.

While it's possible to hide those using styles targeting the decorations' template, it would be nice to add extensibility points so users can choose which title bar elements to display.

Describe the solution you'd like

Add a new property: WindowDrawnDecorations.TitleBarDecorations property of type TitleBarDecorations that users can set on a Window.

This is specifically scoped to the title bar, as borders and resize grips are dependent on WindowDecorations and CanResize.

[Flags]
public enum TitleBarDecorations
{
    None = 0,
    Title = 1 << 0,
    MinimizeButton = 1 << 1,
    MaximizeButton = 1 << 2,
    CloseButton = 1 << 3,
    FullScreenButton = 1 << 4
}

Describe alternatives you've considered

Use styles.

Additional context

No response

Activity

  1. added this to the 12.x milestone on Apr 13, 2026
  2. timunie commented on Apr 13, 2026

    @timunie
    Collaborator

    Can we add Icon to the Enum?

  3. rabbitism commented on Apr 13, 2026

    @rabbitism
    Contributor

    One other enhancement I would like to see: the Window should report the title bar height just like OffScreenMargin, thus user could use this value to set margin of main content.

  4. MrJul commented on Apr 13, 2026

    @MrJul
    MemberAuthor

    Can we add Icon to the Enum?

    There's no icon drawn by WindowDrawnDecorations at the moment. This proposal is about removing existing elements, not adding new ones :)

  5. MrJul commented on Apr 13, 2026

    @MrJul
    MemberAuthor

    One other enhancement I would like to see: the Window should report the title bar height just like OffScreenMargin, thus user could use this value to set margin of main content.

    This is available through WindowDrawnDecorations.TitleBarHeight but I'm aware that's not an easy property to access from the Window itself. Can you please open an issue?

  6. modified the milestones: 12.x, 12.1 on Apr 22, 2026
  7. KrayZeee commented on May 3, 2026

    @KrayZeee

    However, the decorations in v12 have more elements than in v11 (when WindowDecorations == Full), notably a full-screen button and a visible title.

    its not just that, when in fullscreen, you have a flyout when you are with the mouse in the top right corner. as seen in the second screenshot here #21212

    this all behaves like a UWP app, which is replaced by winui3 that doesnt do this anymore. but i think many would already be happy if the window decorations would behave more like a native win32 window, which to be honest, includes the icon.

  8. modified the milestones: 12.1, 12.x on Jul 1, 2026
  9. MrJul commented on Aug 13, 2026

    @MrJul
    MemberAuthor

    Notes from the API review meeting:
    Rename the enum to TitleBarDecorations

  10. added
    api-approvedThe new public APIs have been approved.
    and removed
    api-needs-reviewThe PR adds new public APIs that should be reviewed.
    on Aug 13, 2026
  11. modified the milestones: 12.x, 12.2 on Aug 13, 2026
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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions