Skip to content

Conversation

@Pauliusd01
Copy link
Collaborator

Description

Mirrored from: 1924 as tests couldn't run on it
"Unity's HID layout generator does not generate a layout if one already exists. I added this functionality to the Linux/SDL layout generator."

Testing status & QA

Please describe the testing already done by you and what testing you request/recommend QA to execute. If you used or created any testing project please link them here too for QA.

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity: Low
  • Halo Effect: Low

Comments to reviewers

N/A

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@u-pr
Copy link
Contributor

u-pr bot commented Jan 29, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪

The PR involves a minor logic change in a single file with only a few lines of code added.
🏅 Score: 95

The change concisely implements the intended fix, mirroring established patterns in other layout generators (like HID), though no specific tests were included to verify the scenario.
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected
  • Update review

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@Pauliusd01
Copy link
Collaborator Author

/test_plan

@u-pr
Copy link
Contributor

u-pr bot commented Jan 29, 2026

Test Plan

  • Test plan approved by PR author
  • Test execution in progress
  • Test execution complete
  • Ready for merge

Summary of Changes & Risk Assessment

Summary of Changes

This PR modifies SDLLayoutBuilder.OnFindLayoutForDevice in SDLDeviceBuilder.cs:L19-L21 to prevent the SDL layout generator from creating a layout if a matching layout has already been found by the system. This aligns the SDL behavior with the HID layout generator.

Risk Assessment

  • High Risk Areas: None identified.
  • Medium Risk Areas: None identified.
  • Low Risk Areas: Linux/SDL device discovery and layout matching.

Test Scenarios

Functional Testing

  • Pre-existing Layout Priority: Manually register a layout that matches a specific SDL device description. Verify that OnFindLayoutForDevice returns null (indicating it did not attempt to generate a new layout) when matchedLayout is not null or empty.
  • Fallback to SDL Generation: Provide a device description that does not match any existing layout (matchedLayout is null/empty). Verify that the code proceeds past the new check to evaluate description.interfaceName and capabilities.

Regression Testing

  • Standard Linux Gamepad Discovery: Verify that standard SDL-based gamepads on Linux (which rely on this builder when no specific Unity layout exists) still correctly generate and load their layouts.
  • Interface Filtering: Ensure that non-SDL devices (where interfaceName != "SDL") still return null as expected, even if matchedLayout was empty.

Edge Cases

  • Empty Match String: Verify that if matchedLayout is an empty string "", it is treated the same as null, allowing the SDL builder to proceed.

💡 This test plan updates automatically when /test_plan is run on new commits. If you have any feedback, please reach out in #ai-qa


🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr

@u-pr
Copy link
Contributor

u-pr bot commented Jan 29, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

@codecov-github-com
Copy link

codecov-github-com bot commented Jan 29, 2026

Codecov Report

All modified and coverable lines are covered by tests ✅

@@           Coverage Diff            @@
##           develop    #2334   +/-   ##
========================================
  Coverage    77.95%   77.96%           
========================================
  Files          476      476           
  Lines        97453    97481   +28     
========================================
+ Hits         75971    75999   +28     
  Misses       21482    21482           
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.54% <0.00%> (+<0.01%) ⬆️
inputsystem_MacOS_2022.3_project 75.17% <100.00%> (-0.30%) ⬇️
inputsystem_MacOS_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.07% <100.00%> (-0.30%) ⬇️
inputsystem_MacOS_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.06% <100.00%> (-0.30%) ⬇️
inputsystem_MacOS_6000.4 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.4_project 77.07% <100.00%> (-0.30%) ⬇️
inputsystem_MacOS_6000.5 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.07% <100.00%> (-0.30%) ⬇️
inputsystem_Ubuntu_2022.3 5.54% <0.00%> (+<0.01%) ⬆️
inputsystem_Ubuntu_2022.3_project 74.97% <100.00%> (-0.30%) ⬇️
inputsystem_Ubuntu_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 76.87% <100.00%> (-0.30%) ⬇️
inputsystem_Ubuntu_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 76.87% <100.00%> (-0.30%) ⬇️
inputsystem_Ubuntu_6000.4 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.4_project 76.88% <100.00%> (-0.30%) ⬇️
inputsystem_Ubuntu_6000.5 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5_project 76.88% <100.00%> (-0.30%) ⬇️
inputsystem_Windows_2022.3 5.54% <0.00%> (+<0.01%) ⬆️
inputsystem_Windows_2022.3_project 75.30% <100.00%> (-0.30%) ⬇️
inputsystem_Windows_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 77.19% <100.00%> (-0.31%) ⬇️
inputsystem_Windows_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 77.19% <100.00%> (-0.30%) ⬇️
inputsystem_Windows_6000.4 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.4_project 77.20% <100.00%> (-0.30%) ⬇️
inputsystem_Windows_6000.5 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.5_project 77.20% <100.00%> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...stem/InputSystem/Plugins/Linux/SDLDeviceBuilder.cs 81.53% <100.00%> (+0.28%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pauliusd01
Copy link
Collaborator Author

Picked this up as a safe one to get merged but CI is failing on Linux with issues related to the code. As this needs proper dev attention I'll close it for now. Can be reopened in the future if we have the time to return to it

@Pauliusd01 Pauliusd01 closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants