Skip to content

windows-reactor: SplitView.display_mode() compiles but never reaches WinUI #4837

Closed

Description

Summary

SplitView exposes a .display_mode(SplitViewDisplayMode::…) builder and the WinUI backend already implements Prop::DisplayMode -> ISplitView::SetDisplayMode, but the generated bindings never emit that prop. Calling .display_mode() updates only the Rust struct,WinUI always keeps the default Inline mode.The official sample uses .display_mode(SplitViewDisplayMode::Inline), which matches the WinUI default, so the sample appears to work while the API is effectively broken for every other mode (Overlay, CompactOverlay, CompactInline).

Crate manifest

[package]
name = "split_view_display_mode_repro"
version = "0.1.0"
edition = "2024"
publish = false

[dependencies]
windows-reactor = { git = "https://github.com/microsoft/windows-rs" }

[build-dependencies]
windows-reactor-setup = { git = "https://github.com/microsoft/windows-rs" }

Crate code

build.rs

fn main() {
    windows_reactor_setup::as_example();
}

src/main.rs

use windows_reactor::*;
fn app(_cx: &mut RenderCx) -> Element {
    split_view(
        border(
            text_block(
                "Main content area.\n\
                 In Overlay mode this should stay full width\n\
                 and the pane should float on top.\n\
                 Instead it behaves like Inline (content is pushed aside).",
            )
            .padding(16.0),
        )
        .background(Color::rgb(40, 40, 40)),
    )
    .pane(
        border(
            vstack((
                text_block("Pane content").bold(),
                text_block("display_mode(Overlay) is ignored"),
                text_block("WinUI stays in default Inline mode"),
            ))
            .spacing(8.0)
            .padding(16.0),
        )
        .background(Color::rgb(0, 90, 158)),
    )
    .display_mode(SplitViewDisplayMode::Overlay)
    .is_pane_open(true)
    .open_pane_length(260.0)
    .into()
}
fn main() -> windows_core::Result<()> {
    bootstrap()?;
    App::new()
        .title("SplitView display_mode repro")
        .size(900.0, 500.0)
        .render(app)
}

Activity

  1. kennykerr commented on Aug 18, 2026

    @kennykerr
    Collaborator

    Thanks for the report - working on an update that will prevent such quiet failures from compiling - hopefully have an update out soon.

  2. kennykerr commented on Aug 27, 2026

    @kennykerr
    Collaborator

    As of #4848, SplitView::display_mode is included in the generated property path and reaches WinUI correctly.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions