Reported by a partner integrator (Amazon Lab126 / LeiaViewer port, internal ticket UNITY-133).
Symptom
A standalone build opens on the OS main display rather than on the DisplayXR/SR display. Setting the SR display as the Windows main display makes it launch there — i.e. the app simply follows the OS primary, with no notion of the 3D panel.
Root cause: nothing identifies which monitor the panel is
This is structural, not a small bug:
XR_DXR_display_info (native~/displayxr_extensions.h:21, XrDisplayInfoDXR) carries displaySizeMeters, displayPixelWidth/Height, nominal viewer position and view scales — but no desktop rect, no monitor handle, no device path. The managed mirror Runtime/DisplayXRDisplayInfo.cs reflects the same fields.
- Even the transparent-overlay path never targets the panel:
native~/displayxr_win32.c:1180 and :3137 call MonitorFromWindow(unity_hwnd, MONITOR_DEFAULTTONEAREST) — the overlay follows Unity's window, and is correct today only because Unity happens to be on the right monitor.
So the plugin currently cannot answer "where is the DisplayXR display on the desktop?".
Proposed fix (two parts)
- Runtime (
DisplayXR/displayxr-runtime): extend XR_DXR_display_info with the display's desktop rect and/or a stable device path (\.\DISPLAY1, or the DXGI output device name). Filed separately on that repo.
- Plugin: once available, expose it as
DisplayXRProvider.TryGetDisplayDesktopRect(...) and add an opt-in component / manifest setting that moves the player window onto that monitor at startup (SetWindowPos), before the swapchain settles.
Matching displayPixelWidth/Height against EnumDisplayMonitors is a possible interim heuristic, but it is ambiguous with two same-resolution monitors — prefer the runtime carrying the truth.
Workarounds today
- Set the SR display as the Windows main display.
Screen.MoveMainWindowTo(Display.displays[i], …) (Unity 2021.2+) from app code.
- Launch the player with
-monitor N.
Reported by a partner integrator (Amazon Lab126 / LeiaViewer port, internal ticket UNITY-133).
Symptom
A standalone build opens on the OS main display rather than on the DisplayXR/SR display. Setting the SR display as the Windows main display makes it launch there — i.e. the app simply follows the OS primary, with no notion of the 3D panel.
Root cause: nothing identifies which monitor the panel is
This is structural, not a small bug:
XR_DXR_display_info(native~/displayxr_extensions.h:21,XrDisplayInfoDXR) carriesdisplaySizeMeters,displayPixelWidth/Height, nominal viewer position and view scales — but no desktop rect, no monitor handle, no device path. The managed mirrorRuntime/DisplayXRDisplayInfo.csreflects the same fields.native~/displayxr_win32.c:1180and:3137callMonitorFromWindow(unity_hwnd, MONITOR_DEFAULTTONEAREST)— the overlay follows Unity's window, and is correct today only because Unity happens to be on the right monitor.So the plugin currently cannot answer "where is the DisplayXR display on the desktop?".
Proposed fix (two parts)
DisplayXR/displayxr-runtime): extendXR_DXR_display_infowith the display's desktop rect and/or a stable device path (\.\DISPLAY1, or the DXGI output device name). Filed separately on that repo.DisplayXRProvider.TryGetDisplayDesktopRect(...)and add an opt-in component / manifest setting that moves the player window onto that monitor at startup (SetWindowPos), before the swapchain settles.Matching
displayPixelWidth/HeightagainstEnumDisplayMonitorsis a possible interim heuristic, but it is ambiguous with two same-resolution monitors — prefer the runtime carrying the truth.Workarounds today
Screen.MoveMainWindowTo(Display.displays[i], …)(Unity 2021.2+) from app code.-monitor N.