Skip to content

[Win32] Adjust sizing when maximized and titlebar is extended #21745

Description

@MartinZikmund

What would you like to be added? 💡

Currently the WindowChrome is applying padding to prevent UI from going out of screen when maximized. To properly support this, we should apply the padding on the native level, so that WindowChrome takes up the full screen.

Also validate sizing for maximized WinUI app and Uno app matches for the same screen.

Why is this needed? 🤔

No response

Renderer 🎨

  • Skia
  • Native

For which platforms 📱💻🖥️

Desktop (Windows)

Anything else we need to know? 💬

No response

Activity

  1. self-assigned this
    on Nov 4, 2025
  2. added
    kind/enhancement
    triage/untriaged
    difficulty/tbd
    on Nov 4, 2025
  3. changed the title [-][Win32] Adjust sizing when maximized[/-] [+][Win32] Adjust sizing when maximized and titlebar is extended[/+] on Nov 4, 2025
  4. MartinZikmund commented on Nov 20, 2025

    @MartinZikmund
    MemberAuthor

    We also need to validate we get values equivalent to WinUI from:

    • AppWindow.Size
    • AppWindow.ClientSize
    • AppWindow.Position
    • Window.Bounds
    • XamlRoot.Bounds
    • XamlRoot.Content.ActualSize

    Most can be verified in src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/AppWindowPositionAndSize.xaml

  5. added
    area/windowing
    and removed
    triage/untriaged
    difficulty/tbd
    on Nov 20, 2025
  6. added theissue type on Nov 28, 2025
  7. github-actions commented on May 17, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  8. added
    stale
    on May 17, 2026
  9. removed
    stale
    on May 18, 2026
  10. removed their assignment
    on May 18, 2026
  11. added 4 commits that reference this issue on Jun 29, 2026
    daa9ae0
    4916358
    b1c2057
    a90358a
  12. self-assigned this
    on Aug 3, 2026
  13. khaskoul commented on Aug 3, 2026

    @khaskoul
    Image
    Runtime    Uno Skia Win32 — Uno.UI 6.7.0-dev.914+917810172f8f4ef061e0caaa8be66c92a62d1403-master.917810172f8f4ef061e0caaa8be66c92a62d1403
    State      Maximized  extended=True  height=Standard (32px)
    Scale      1  (96 dpi)
    Window     Bounds=(0,0) 1920x1032 dip
    AppWindow  pos=(-1928,-230) size=1936x1048 client=1920x1032
    XamlRoot   1920x1032 dip -> 1920x1032 px
    Content    (0,0) to (1920,1032) dip, size 1920x1032
    Root chain XamlIslandRoot > WindowChrome > Grid > ContentPresenter > Shell
    Chrome     Uno.UI.Xaml.Controls.WindowChrome
               size 1920x1032 dip
               Padding=0,0,0,0  Margin=0,0,0,0
    Native     window=(-1928,-230) 1936x1048  client=(-1920,-222) 1920x1032
               extFrame=(-1920,-222) 1920x1032
               monitor=(-1920,-222) 1920x1080  work=(-1920,-222) 1920x1032
               resizeFrame=4x4  paddedBorder=4  IsZoomed=True
               styles=0x15C70000 (WS_CAPTION|WS_BORDER|WS_THICKFRAME|WS_MAXIMIZE|WS_MAXIMIZEBOX|WS_MINIMIZEBOX|WS_VISIBLE)
               native handle: 0x170690 via EnumWindows (class UnoPlatformRegularWindow)
    Checks
      [PASS] titlebar-extended
               ExtendsContentIntoTitleBar=True — the configuration #21745 is about
      [PASS] client-covers-workarea (#21745)
               client (-1920,-222) 1920x1032 vs work area (-1920,-222) 1920x1032 — a maximized WinUI window covers the work area exactly
      [PASS] no-offscreen-client
               client (-1920,-222) 1920x1032 must stay inside the work area (-1920,-222) 1920x1032; window rect is (-1928,-230) 1936x1048 (overhang L8 T8 R8 B8 — absorbed natively by WinUI)
      [PASS] xaml-fills-client (#21745)
               XamlRoot 1920x1032px vs native client 1920x1032px (delta 0x0)
      [PASS] content-fills-xamlroot (#21745)
               Window.Content spans (0,0) to (1920,1032) of a 1920x1032 XamlRoot — WindowChrome must not inset it
      [PASS] chrome-fills-xamlroot (#21745)
               Uno.UI.Xaml.Controls.WindowChrome is 1920x1032 dip of a 1920x1032 dip XamlRoot
      [PASS] chrome-insets-zero (#21745)
               Padding=0,0,0,0, Margin=0,0,0,0
    
    Check Meaning
    client-covers-workarea Maximized client rect == monitor work area
    no-offscreen-client Client rect stays inside the work area
    xaml-fills-client XamlRoot in px == native client area (no managed inset)
    content-fills-xamlroot Window.Content spans the whole XamlRoot from (0,0)
    chrome-fills-xamlroot WindowChrome takes up the full screen — the issue's own wording
    chrome-insets-zero No managed padding on WindowChrome
    Component Version
    Uno.Sdk (global.json) 6.7.0-dev.160
    Uno.WinUI (resolved) 6.7.0-dev.914
    Uno.UI.dll / Uno.UI.Runtime.Skia.Win32.dll 6.7.0-dev.914+9178101 (master, commit 917810172f8f4ef061e0caaa8be66c92a62d1403)
    Uno.Material.WinUI 7.1.0-dev.1 (157ff71)
    Uno.Toolkit.WinUI / .Material 9.1.0-dev.2 (75e47af)
    Uno.Extensions.* 7.3.0-dev.115 (a96b521)
    Uno.Resizetizer 1.13.0-dev.17
    SkiaSharp 3.119.2
    Environment Value
    .NET SDK 10.0.302
    TFMs built net10.0-desktop, net10.0-windows10.0.26100, net10.0-browserwasm (all 0 warnings / 0 errors)
    RID win-x64
    Windows SDK ref pack 10.0.26100.57
    OS Windows 11 Pro, build 10.0.26200
    Screen used 1920×1080 @ 150% (144 dpi), work area 1920×1008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ai/automatedarea/windowingkind/enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions