Skip to content

FIX: Allow InputSystem class to set runtime runInBackground field#1662

Merged
jfreire-unity merged 3 commits intodevelopfrom
fix-platform-specific-run-in-background
Mar 31, 2023
Merged

FIX: Allow InputSystem class to set runtime runInBackground field#1662
jfreire-unity merged 3 commits intodevelopfrom
fix-platform-specific-run-in-background

Conversation

@jfreire-unity
Copy link
Copy Markdown
Collaborator

@jfreire-unity jfreire-unity commented Mar 22, 2023

Description

Some platforms' background behavior isn't reflected in Application.runInBackground. This PR exposes InputSystem.runInBackground to be called by those particular platforms to tell the Input System that the platform runs in the background.

It should be considered for "internal use" only even though it is part of the public API.

Context: This is the alternative for the rejected PR #1648. Specific platforms can call this API as they wish, otherwise, we rely on Application.runInBackground set in the Editor settings for platforms that allow being run in the background.

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • 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.

@jfreire-unity jfreire-unity changed the title Allow InputSystem class to set runtime runInBackground field WIP Allow InputSystem class to set runtime runInBackground field Mar 22, 2023
Copy link
Copy Markdown
Collaborator

@lyndon-unity lyndon-unity left a comment

Choose a reason for hiding this comment

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

Seems reasonable but I don't know all the connection between platform packages and the main package to be sure this is the best way to handle it.

Comment thread Packages/com.unity.inputsystem/InputSystem/InputSystem.cs Outdated
Comment thread Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs Outdated
@jfreire-unity jfreire-unity force-pushed the fix-platform-specific-run-in-background branch 2 times, most recently from f59bdc5 to b2e6a7f Compare March 27, 2023 16:34
@jfreire-unity jfreire-unity changed the title WIP Allow InputSystem class to set runtime runInBackground field Allow InputSystem class to set runtime runInBackground field Mar 28, 2023
@jfreire-unity jfreire-unity force-pushed the fix-platform-specific-run-in-background branch from f5dade2 to 53cf4e8 Compare March 28, 2023 15:06
@jfreire-unity jfreire-unity marked this pull request as ready for review March 28, 2023 15:06
@jfreire-unity jfreire-unity force-pushed the fix-platform-specific-run-in-background branch from 53cf4e8 to 303b655 Compare March 28, 2023 15:22
@jfreire-unity jfreire-unity changed the title Allow InputSystem class to set runtime runInBackground field FIX: Allow InputSystem class to set runtime runInBackground field Mar 31, 2023
@jfreire-unity
Copy link
Copy Markdown
Collaborator Author

After going through all the options, I decided to go with the Public API direction for now.
There's no "Plugin" concept in the InputSystem where a setting like this should live and it would involve a bigger effort at the moment. This should be the direction to go next.

@jfreire-unity jfreire-unity force-pushed the fix-platform-specific-run-in-background branch from 303b655 to 61beef2 Compare March 31, 2023 12:05
@jfreire-unity jfreire-unity merged commit 3c10099 into develop Mar 31, 2023
@jfreire-unity jfreire-unity deleted the fix-platform-specific-run-in-background branch March 31, 2023 17:02
@BraveSirAndrew
Copy link
Copy Markdown

@jfreire-unity Yo. Sorry to butt in but this is a breaking change for anyone who is implementing the IInputRuntime interface. Just saying. Also hi!

@lyndon-unity lyndon-unity removed the request for review from jimon April 18, 2023 08:16
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.

6 participants