Skip to content

DockPanel.Dock="Bottom" content invisible at 125% display scaling (100% works) #22094

Description

@ajoh99

Describe the bug

At 125% display scaling on Windows, DockPanel.Dock="Bottom" content is not rendered at all — the sibling Fill element (the last, un-docked child) paints over the entire remaining area with no visible trace of the docked content, and no error, warning, or exception of any kind.

At 100% scaling, the identical XAML renders correctly.

This reproduces with the two most basic controls Avalonia has (TextBlock + Border), with no bindings, styles, or custom controls involved, so it isn't specific to any particular app.

Reproduction steps

  1. Create a new Avalonia app from the default template (dotnet new avalonia.app).
  2. Set the Windows display scaling to 125% (Settings → System → Display → Scale).
  3. Replace MainWindow.axaml content with:
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="DockBottomRepro.MainWindow"
        Title="DockBottomRepro">

    <DockPanel>
        <TextBlock DockPanel.Dock="Bottom" Text="BOTTOM TEXT" Background="Yellow" FontSize="24" />
        <Border Background="LightBlue" />
    </DockPanel>

</Window>
  1. Run the app.

Expected: a yellow "BOTTOM TEXT" strip at the bottom of the window, light blue everywhere else (matches the behavior at 100% scaling, and matches WPF's DockPanel behavior).

Actual: the window is solid light blue — the bottom-docked TextBlock never appears. No exception, no binding error, no XAML warning. Confirmed via a real desktop screen capture (not a PrintWindow/GDI capture, to rule out a screenshot-tool artifact) with the window genuinely in the foreground.

Setting DockPanel.Dock="Top" on the same TextBlock (with the same Border as the trailing/fill child) works correctly at 125% scaling — only Bottom is affected in my testing (I did not exhaustively test Left/Right).

What I've ruled out

I hit this in a real app (a DockPanel inside a UserControl inside a Window, with real bindings) and spent considerable effort isolating the actual cause before landing on display scaling. Along the way I ruled out:

  • Avalonia version: reproduces identically on 11.3.20 (latest stable 11.x) and 12.1.1 (latest stable 12.x) — not a v12-specific regression.
  • Rendering backend: reproduces identically with Win32PlatformOptions.RenderingMode = [Win32RenderingMode.Software] forced — not a GPU/driver-specific compositing issue. (Machine has a hybrid Intel UHD 630 / NVIDIA GTX 1650 Max-Q Optimus setup, in case that's independently relevant to anyone else's repro.)
  • Client-side decorations: reproduces identically with WindowDecorations="Full" + ExtendClientAreaToDecorationsHint="False" explicitly set (i.e. not specific to the new Avalonia 12 app-drawn decorations path).
  • AvaloniaUI.DiagnosticsSupport / .WithDeveloperTools(): reproduces identically with that hook removed entirely.
  • UseLayoutRounding="False" on the Window (the fix for Layout precision error in Avalonia 11 #8866, a different fractional-DPI layout bug that also manifests specifically at 125%): does not fix this — so this looks like a distinct issue from Layout precision error in Avalonia 11 #8866, just triggered by the same category of non-integer scale factor.

The one variable that reliably flips the behavior, tested by switching the actual Windows display scaling setting (not a manifest/registry per-app DPI override) and relaunching each time:

Scaling Result
100% ✅ Bottom-docked content renders correctly
125% ❌ Bottom-docked content invisible

Environment

  • Avalonia: 11.3.20 and 12.1.1 (both tested, same result)
  • OS: Windows 10 Home, 10.0.19045
  • .NET SDK: 10.0.400, target framework net10.0
  • GPU: Intel(R) UHD Graphics 630 (driver 26.20.100.7870) + NVIDIA GeForce GTX 1650 with Max-Q Design (driver 27.21.14.5749) — hybrid/Optimus laptop
  • Display scaling: 125% (bug present) vs 100% (bug absent), single monitor, no mixed-DPI setup involved

Possibly related

I found some older/adjacent reports that may share a root cause or at least the same general area of the layout engine, though none matches this exactly:

  • Panel does not take all remaining space #4628 (closed) — a comment from a different user describes the same "DockPanel Top/Bottom docks overlap in newer versions, Grid RowDefinitions="Auto,*,Auto" works instead" symptom, but in my own testing that Grid pattern (Auto-row-after-*-row) also failed to render the trailing content at 125% scaling — so if it's the same bug, the reported workaround isn't reliable either, at least not on this setup.
  • DockPanel Docking not completly working #348, DockPanel overlay elements #2639 — older DockPanel dock-order/overlay rendering bugs, possibly unrelated but in the same area of the codebase.
  • Layout precision error in Avalonia 11 #8866 — the closest DPI-specific precedent I found (also 125%-specific, also fine at 100%), but its confirmed root cause (Border not accounting for its own layout rounding when arranging an opaque child) and its fix (UseLayoutRounding="False") do not apply here — I tested it directly and it made no difference.

Happy to provide a runnable repro project if useful.

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions