Skip to content

[Win32] NavigationView compact pane stays empty after the window is minimized and restored #26672

In review

Description

@ajpinedam

Current behavior 🐛

On Skia Win32, a NavigationView in LeftCompact mode shows an empty pane after the window is minimized and restored. The menu and footer items are gone; only the pane background is drawn.

  • The items are still in the visual tree, loaded, visible and laid out at the right size and place. UI Automation reports them with empty bounds and off-screen.
  • Waiting, maximizing, or minimizing again does not bring them back. Resizing the window below the app's narrow breakpoint and back does.
  • Seen on every attempt (Windows 11, 150% display scaling).

The pane is clipped away. After the restore, PaneRoot's clip (PaneClipRectangleTransform.TranslateX) is +72 instead of −248 (CompactPaneLength − OpenPaneLength = 72 − 320). The clip then covers x 72..392, so the 0..72 compact strip shows nothing.

Expected behavior 🎯

After a minimize and restore, the compact pane looks and works as before.

More generally: when SplitView.OpenPaneLength or CompactPaneLength changes while a display-mode state is active, the pane clip follows the new length.

How to reproduce it (as minimally and precisely as possible) 🔬

Minimal, deterministic (no minimize needed, any Skia target):

var splitView = new SplitView
{
    Width = 600,
    Height = 400,
    DisplayMode = SplitViewDisplayMode.CompactOverlay,
    CompactPaneLength = 72,
    OpenPaneLength = 0,
    Pane = new Border(),
    Content = new Border(),
};
// Put it on screen and wait until it is loaded.

splitView.OpenPaneLength = 320;

// Find "PaneRoot" in the template: ((CompositeTransform)((RectangleGeometry)paneRoot.Clip).Transform).TranslateX
// Expected: 72 - 320 = -248. Actual: 72 (the value computed when ClosedCompactLeft was entered at length 0).

The user-facing scenario (Skia Win32):

  1. Use a NavigationView with PaneDisplayMode="LeftCompact" and a few menu/footer items, plus an AdaptiveTrigger that switches it to LeftMinimal when narrow:

    <VisualStateGroup>
      <VisualState x:Name="Narrow">
        <VisualState.StateTriggers><AdaptiveTrigger MinWindowWidth="0" /></VisualState.StateTriggers>
        <VisualState.Setters>
          <Setter Target="Nav.PaneDisplayMode" Value="LeftMinimal" />
        </VisualState.Setters>
      </VisualState>
      <VisualState x:Name="Wide">
        <VisualState.StateTriggers><AdaptiveTrigger MinWindowWidth="700" /></VisualState.StateTriggers>
      </VisualState>
    </VisualStateGroup>
  2. Run on Windows (Skia desktop) with the window wider than 700.

  3. Minimize the window (title bar, taskbar or Win+D), then restore it.

  4. The compact pane is empty.

Workaround 🛠️

Re-enter the SplitView's current DisplayModeStates state whenever OpenPaneLength changes, so its setters are read again:

splitView.RegisterPropertyChangedCallback(SplitView.OpenPaneLengthProperty, (s, _) =>
{
    var split = (SplitView)s;
    var state = /* current state of the "DisplayModeStates" group on the template root */;
    if (state is not null && state != "Closed")
    {
        VisualStateManager.GoToState(split, "Closed", false);
        VisualStateManager.GoToState(split, state, false);
    }
});

OnPropertyChanged2 runs before callbacks registered this way, so the template settings are already updated when it runs. Resizing the window below the narrow breakpoint and back also recovers.

Affected platforms 📱💻🖥️

Skia Desktop (Windows) for the minimize trigger. The SplitView refresh problem itself is not platform-specific; the minimal repro above fails on Skia desktop.

Uno.Sdk version (and other relevant versions) 📦

Uno.Sdk.Private 7.1.0-dev.484 (commit 514df92). The code paths below are unchanged on master 7223920.

IDE version 🧑‍💻

N/A

Anything else we need to know? 💬

Two defects combine. Fixing either one removes the symptom; the first is the general one.

1. A changed pane length never reaches the active state's setters (all platforms).

  • The Fluent SplitView template sets the clip with a bound setter, e.g. ClosedCompactLeft: <Setter Target="PaneClipRectangleTransform.TranslateX" Value="{Binding …TemplateSettings.NegativeOpenPaneLengthMinusCompactLength}" /> (SplitView_themeresources.xaml).
  • The setter's target keeps the value read when the state was entered.
  • SplitView.OnPropertyChanged2 handles OpenPaneLength/CompactPaneLength with UpdateTemplateSettings() then UpdateVisualState(useTransitions: false), commented "Force the bindings in our VisualState animations to refresh".
  • But VisualStateManager.GoToStateCorePrivateBaseImplementation returns early when the group is already in the requested state ("Already in the right state"), so nothing is refreshed.

2. A minimized Win32 window is laid out at 0×0.

Sequence on restore:

  1. The window bounds come back; the app's AdaptiveTrigger switches PaneDisplayMode back to LeftCompact.
  2. SplitView.DisplayMode becomes CompactOverlay and enters ClosedCompactLeft while OpenPaneLength is still 0. The setter writes TranslateX = 72 − 0 = +72.
  3. NavigationView.OnSizeChanged then restores OpenPaneLength = 320. The template settings update to −248, but the refresh in step (1) above is a no-op, so TranslateX stays +72.

From reading the code (not tested), PaneDisplayMode="Auto" alone should not show it: NavigationView.OnSizeChanged calls UpdateOpenPaneLength before UpdateAdaptiveLayout, so the compact state is entered with the restored length.

A narrower window shows the same staleness without the symptom. After a round trip through a 252 px wide window, TranslateX stays at −180 (72 − 252) instead of −248. The clip is wrong but still covers the compact strip.

Activity

  1. added
    triage/untriaged
    on Nov 23, 2026
  2. self-assigned this
    on Nov 23, 2026
  3. MartinZikmund commented on Nov 24, 2026

    @MartinZikmund
    Member

    @ajpinedam can you confirm whether the issue is coming from WinAppSDK?

  4. ajpinedam commented on Nov 24, 2026

    @ajpinedam
    ContributorAuthor

    @ajpinedam can you confirm whether the issue is coming from WinAppSDK?

    @MartinZikmund

    No, it doesn't come from WinAppSDK. It only happens on the Skia desktop target (Uno's Win32 host); native WinUI behaves correctly:

    I ran the same NavigationView page (LeftCompact with an AdaptiveTrigger switching to LeftMinimal) in a WinAppSDK app. After minimize/restore the compact pane is intact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

triage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions