Skip to content

fix(#291): window-space UI aspect from the composited window, not Screen.* - #349

Merged
dfattal merged 2 commits into
mainfrom
fix/wsui-panel-aspect-overlay
Oct 2, 2026
Merged

dfattal merged 2 commits into
mainfrom
fix/wsui-panel-aspect-overlay

Conversation

@dfattal

@dfattal dfattal commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #291 for transparent-overlay apps: lenovo-avatar's radio and tuning HUDs rendered squeezed.

Root cause: DisplayXRWindowSpaceUI derived its RT aspect from Screen.*. In a transparent-overlay app that's Unity's own cloaked, parked window, at whatever size Unity persisted. On the Windows panel box we saw Screen = 3872x2248, then 512x728 after clearing the persisted Screenmanager Resolution (it grows by the frame size, +32x88, every run). The window the runtime actually composites into was 808x1280 (portrait), so the runtime's stretch into the panel rect was far from the identity.

Change

Testing

Windows Leia panel, runtime v2.22.0, lenovo-avatar (transparent overlay, Gamma) built against main + #348 + this branch, D3D12:

before: [DisplayXR] wsui: panel size source = Screen.* (3872x2248)   -> RTs 1412x820, 1074x650
after:  [DisplayXR] wsui: panel size source = composited window (808x1280) -> RTs 518x820, 393x650

No errors or WARN lines. On-panel eyeball by David is pending.

Not covered yet: Linux (Byungju), the editor docked path (the composited size there is the Game-view pane, the same thing the eyes are sized from), and the shell (unchanged: the tile source still wins).

🤖 Generated with Claude Code

dfattal and others added 2 commits October 2, 2026 00:15
… window, not Screen.*

In a transparent-overlay app Unity's own window is cloaked and parked, so Screen.*
reports whatever size Unity persisted (observed 512x728 and 3872x2248 next to a
3840x2160 overlay; it grows by the window frame on every run). DisplayXRWindowSpaceUI
derived its RT aspect from it, so the runtime's stretch into the panel rect was not
the identity and the HUD came out squeezed (lenovo-avatar's radio/tuning HUDs).

The provider now publishes the live size of the window (or workspace tile) the
runtime composites into, the number the eye swapchain is already sized from, as a
cached value (dxr_prov_get_composited_size). On Linux the measurement uses the X
connection the runtime borrows, so it must not be queried from Unity's main thread.
The window-space UI prefers it over Screen.*, after the workspace-tile canvas (#323).
It falls back to Screen.* with no provider session or against an older native plugin.
Only the aspect is used, so the native-DPI pixels need no conversion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…HUD rects are fractions of

Apps that lay out HUD rects (e.g. lenovo-avatar's HudPanelLayout) used Screen.* so their
math matched the RT aspect the component derived from it. With the composited-window
source that is no longer the same number in a transparent-overlay app on Windows, so
expose the component's own source chain (workspace tile, then composited window, then
Screen.*) as a public static. The shell-mode and size helpers become static to share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dfattal
dfattal marked this pull request as ready for review October 2, 2026 08:58
@dfattal
dfattal merged commit 3ebc02e into main Oct 2, 2026
8 checks passed
@dfattal
dfattal deleted the fix/wsui-panel-aspect-overlay branch October 2, 2026 08:58
dfattal added a commit that referenced this pull request Oct 2, 2026
…from the merged source

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

DisplayXRWindowSpaceUI: pre-distortion is not undone by the compositor on every path — UI renders squashed

1 participant