Skip to content

Windows: Direct3D 12, MSIX packaging, screen readers (AccessKit), maximize fix - #64

Merged
ppmpreetham merged 5 commits into
mainfrom
windows-platform
Nov 25, 2026
Merged

ppmpreetham merged 5 commits into
mainfrom
windows-platform

Conversation

@ppmpreetham

Copy link
Copy Markdown
Owner

What does this change?

Stacked on #63 (base css-specs), which is stacked on #62; merge those first. Four commits:

maximize button

  • The kit took every press on a maximize button as the app's, so on a window with the system's title bar Windows never maximized.
  • Only a title bar the app draws (WindowDecorations::Client) hands its maximize button to the app now.

d3d12 backend

  • Opt-in Direct3D 12 renderer: Application::gpu_api(GpuApi::D3d12), BUI_gpu_set_api, BUI_GPU_API=d3d12, or a default stored in the executable.
    • Direct3D 11 stays the default, and a device that can't start on 12 starts on 11.
    • Both backends share one core (gpu_device.c) through a 15-operation BuiGpuOps table, and draw byte-identical frames.
    • Direct3D 12 costs about 0.4 to 1 ms more CPU per presented frame here, so it is for D3D12 interop and Nsight's GPU Trace.
  • Debug layer: BUI_GPU_DEBUG=2 turns it on; it reports 0 errors, warnings and leaks on AMD and NVIDIA.
  • BUI_GPU_ADAPTER=high-performance: renders on the discrete GPU of a hybrid laptop. The default stays the display's GPU; vendor profilers only see work on their GPU.

cli packaging

  • bui build app.jsx --msix makes an MSIX package (installable, Store-ready; the modern form of UWP packaging) instead of a bare .exe.
  • --gpu d3d11|d3d12 stores which Direct3D the app starts with.
  • bui package app.exe --msix|--gpu does both for any BUI executable (Rust, C ...).
  • Identity options: name, version, publisher, icon, include, cert. Packaging uses the Windows SDK's makeappx, and signtool to sign.

a11y windows

  • Screen readers through AccessKit. One accessibility tree per window, owned by the C kit:
    • widgets declare their roles;
    • the Rust HTML engine adds the page under its canvas, mapped like a browser's HTML-AAM and accname.
  • Requests come back as real input: press, toggle, set a value, increment, expand, focus.
  • AccessKit is used only by the new a11y/ crate (bui-a11y). It runs UI Automation through WM_GETOBJECT, sends only changed nodes, and builds nothing until a reader asks.
  • The a11y feature: on for Rust and Node; optional for CMake builds, where it needs cargo.
  • examples/a11y.rs is a small app to try with Narrator. macOS and Linux are next.

How was it tested?

  • ctest --test-dir build passes (the GPU ctests, including new *_d3d12 variants, passed in the working tree on the AMD iGPU and the RTX 3050 Ti)
  • cargo test passes: whole workspace in the working tree. At the d3d12 backend commit the GPU and render-target tests pass on Direct3D 12.
  • Added or updated tests:
    • bui-a11y unit tests;
    • tests/suite/a11y.rs, with headless trees and reader requests;
    • bindings/node/test/windows.test.js;
    • gpu/tests/test_gpu_api.h.
  • Benchmarks: bench_frames with a11y on and no reader attached shows no change. Direct3D 12 frame costs are listed above.

A real UI Automation client (PowerShell System.Windows.Automation) read the example window:

  • The tree: Document, Edit, Button, List and ListItem, CheckBox, Slider and ComboBox, with names, values and states.
  • SetValue / Invoke: setting the field's value and invoking Add created a task through on_click.
  • Toggle and Slider SetValue both worked.

makeappx packed a real BUI executable, and the unpacked manifest and logos were checked. Narrator itself was not tried by ear.

Checklist

  • CHANGELOG.md updated (Unreleased)
  • Docs updated:
    • environment variables, rendering, standalone executables and the JavaScript guide;
    • FAQ, limitations and roadmap, which now describe accessibility.
  • New C files carry the SPDX-License-Identifier: GPL-2.0-or-later header

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ppmpreetham
ppmpreetham changed the base branch from css-specs to main November 25, 2026 11:02
@ppmpreetham
ppmpreetham merged commit e3e0cc1 into main Nov 25, 2026
31 of 32 checks passed
@ppmpreetham ppmpreetham mentioned this pull request Nov 25, 2026
5 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant