diff --git a/app/src/main/cpp/ExternalVR.cpp b/app/src/main/cpp/ExternalVR.cpp index 6b5fa94c3b..72c56643c5 100644 --- a/app/src/main/cpp/ExternalVR.cpp +++ b/app/src/main/cpp/ExternalVR.cpp @@ -262,6 +262,7 @@ mozilla::gfx::VRControllerType GetVRControllerTypeByDevice(device::DeviceType aT case device::UnknownType: default: result = mozilla::gfx::VRControllerType::_empty; + assert(!"Unknown controller type."); VRB_LOG("Unknown controller type."); break; } diff --git a/app/src/openxr/cpp/OpenXRInputSource.cpp b/app/src/openxr/cpp/OpenXRInputSource.cpp index 9804156b2e..578b0c0cc0 100644 --- a/app/src/openxr/cpp/OpenXRInputSource.cpp +++ b/app/src/openxr/cpp/OpenXRInputSource.cpp @@ -73,7 +73,9 @@ XrResult OpenXRInputSource::Initialize() for (auto& mapping: OpenXRInputMappings) { // Always populate default/fall-back profiles if (mapping.controllerType == device::UnknownType) { - mMappings.push_back(mapping); + mMappings.push_back(mapping); + // Use the system's deviceType instead to ensure we get a valid VRController on WebXR sessions + mMappings.back().controllerType = deviceType; continue; } else if (deviceType != mapping.controllerType) { continue;