From 1e65e4c54ac15019156a14a0a55bfbe62a102349 Mon Sep 17 00:00:00 2001 From: dfattal Date: Thu, 23 Jul 2026 09:16:11 +0900 Subject: [PATCH] feat(avatar): engine_render_gated manifest flag + DemoWindowController shell guard (#225) Workspace-tile support for the desktop-avatar sample, pairing with the runtime xrGetWorkspaceTileSizeDXR + provider consumption + shell per-app show mode (displayxr-shell-pvt#80): - installer/common/SampleInstaller.nsh: emit "engine_render_gated": true in the registered-mode manifest. Unity apps gate render on the main window being SHOWN, so the shell must launch them SW_SHOWMINNOACTIVE (not SW_HIDE); the flag opts every Unity sample into that per-app show mode. - DemoWindowController: no-op in shell/tile mode (displayxr_is_shell_mode()). The shell/runtime own the tile window there; persisting/restoring our saved size would fight the runtime's tile-resize AND corrupt the standalone size (it would save the tile size to PlayerPrefs). Standalone behavior unchanged. The provider reports the tile canvas via the size APIs, so the avatar authors its zone/Local2D for the tile with no default-resolution change needed. Co-authored-by: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01Umm4stoD3G9SuNeocafhPn --- installer/common/SampleInstaller.nsh | 5 +++++ samples/desktop-avatar/Assets/DemoWindowController.cs | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/installer/common/SampleInstaller.nsh b/installer/common/SampleInstaller.nsh index 505802d..bb6a47a 100644 --- a/installer/common/SampleInstaller.nsh +++ b/installer/common/SampleInstaller.nsh @@ -180,6 +180,11 @@ Section "${SAMPLE_DISPLAY_NAME}" SecApp FileWrite $0 ' "icon": "icon_${SAMPLE_SLUG}.png",$\r$\n' FileWrite $0 ' "icon_3d": "icon_sbs_${SAMPLE_SLUG}.png",$\r$\n' FileWrite $0 ' "icon_3d_layout": "sbs-lr",$\r$\n' + ; Unity/engine apps gate their render on the main window being SHOWN, so the + ; shell must launch them SW_SHOWMINNOACTIVE (not SW_HIDE) and they read + ; xrGetWorkspaceTileSizeDXR for tile size. Opt-in flag consumed by the shell's + ; per-app show mode (displayxr-shell-pvt#80). All Unity samples are engine-gated. + FileWrite $0 ' "engine_render_gated": true,$\r$\n' ${WordReplace} "$INSTDIR" "\" "/" "+" $1 FileWrite $0 ' "exe_path": "$1/${APP_EXE}"$\r$\n' FileWrite $0 '}$\r$\n' diff --git a/samples/desktop-avatar/Assets/DemoWindowController.cs b/samples/desktop-avatar/Assets/DemoWindowController.cs index 9a47fe7..e418111 100644 --- a/samples/desktop-avatar/Assets/DemoWindowController.cs +++ b/samples/desktop-avatar/Assets/DemoWindowController.cs @@ -104,6 +104,14 @@ void Update() #if UNITY_STANDALONE_WIN if (Application.isEditor) return; + // Workspace-tile mode (#225): the shell/runtime owns the window — it + // syncs the hidden window to the tile's 3D-window pixel rect so Kooima + // (from the tile pose) matches the render aspect (this is what every + // other tile app gets for free). Restoring/persisting our own portrait + // size here overrides that cell-resize and mismatches Kooima → the whole + // scene stretches. So this window-chrome policy is inert as a tile. + if (DisplayXRNative.displayxr_is_shell_mode() != 0) return; + // Remember / restore window size AND position across launches (the split // persists separately in TigerSpeechBubble). On the first valid frame, // restore the last-saved size + position; thereafter, track changes in