Skip to content
Merged
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 @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed a control declared for several variants at once (for example `"variants" : "A;B"`) only merging with derived layouts under its first variant; derived overrides for the other variants lost the base control's layout, offset, format and usages. [UUM-160829](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-160829)
- Fixed duplicate entries appearing in the Input Actions Editor binding path search for some devices, such as Mouse and XR controllers. [UUM-160646](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-160646)
- Fixed closed Input Device Debugger windows staying in memory until the next domain reload. [ISX-3179]
- 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 thread
vrdave-unity marked this conversation as resolved.
Resolved

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

Expand Down
Loading