Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Assets/Tests/InputSystem/Plugins/XRTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ public void Devices_XRDeviceCharacteristicsDeterminesTypeOfDevice(InputDeviceCha
Assert.That(generatedLayout.baseLayouts, Is.EquivalentTo(new[] { new InternedString(baseLayoutName) }));
}

[Test]
[Category("Devices")]
public void Devices_XRHMDLayoutInheritsCanRunInBackgroundFromBaseLayout()
{
var deviceDescription = CreateSimpleDeviceDescriptionByType(InputDeviceCharacteristics.HeadMounted);
runtime.ReportNewInputDevice(deviceDescription.ToJson());

InputSystem.Update();

var baseLayout = InputSystem.LoadLayout("XRHMD");
var generatedLayout = InputSystem.LoadLayout(
$"{XRUtilities.InterfaceCurrent}::{deviceDescription.manufacturer}::{deviceDescription.product}");

Assert.That(baseLayout.canRunInBackground, Is.Not.Null);
Assert.That(generatedLayout.canRunInBackground, Is.EqualTo(baseLayout.canRunInBackground));

// No device command callback is registered, so QueryCanRunInBackground fails (UUM-139700)
Assert.That(InputSystem.devices[0].canDeviceRunInBackground, Is.EqualTo(baseLayout.canRunInBackground.Value));
}

[Test]
[Category("Devices")]
public void Devices_CanChangeHandednessOfXRController()
Expand Down
1 change: 1 addition & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- Fixed polling for interaction phases (such as `WasPerformedThisFrame`) being missed during `Update` due to interaction timeouts sometimes occurring during the later before-render period when a before-render device (such as an XR HMD) is added. This means that timeouts and interactions like Hold may now wait to perform until the next frame instead of the earliest chance during before-render. [UUM-147719](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-147719)
- Fixed XR HMD device regeneration not copying the `canRunInBackground` parameter from its base layout, causing the XR app view to become locked to the tracking origin and frozen in place when the application regained focus after the headset went to sleep or a system menu was opened. [UUM-139700](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-139700)

## [1.20.1] - 2026-10-05

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,9 @@ public void MergeLayout(InputControlLayout other)

m_UpdateBeforeRender = m_UpdateBeforeRender ?? other.m_UpdateBeforeRender;

if (canRunInBackground == null)
canRunInBackground = other.canRunInBackground;
Comment on lines +1304 to +1305

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If canRunInBackground is not null and has some value, should the 2 not be | together?


if (m_Variants.IsEmpty())
m_Variants = other.m_Variants;

Expand Down
Loading