Files
UnrealEngineUWP/Engine/Plugins/Runtime/CommonUI/Source
jan orlowski 2233006333 Splitscreen UI: Default that player's action router input mode back to default when the root layout is dormant.
When we leave a game P2s action router has the game input mode. When we leave, we switch our leto mode from ELetoDisplayMode::Simultaneous to just ELetoDisplayMode::SingleToggle. When that happens, P2s root layout becomes dormant and sets P2 action router's bIsActivatableTreeEnabled to false (due to UFortRootViewportLayout::OnIsDormantChanged calling ActionRouter->SetIsActivatableTreeEnabled(!bIsDormant)). When bIsActivatableTreeEnabled is false it means that P2s action router doesn't have a chance to call SetActiveRoot(NewActiveRoot) (which is done on tick when not dormant) and our input mode stays as game. Then, whenever we call refresh, since ActionDomainRootNodes hasn't been updated from the tick we end up calling SetActiveUIInputConfig(FUIInputConfig(ActionDomainTable->InputMode, ActionDomainTable->MouseCaptureMode)) which sets the inputMode to still be Game.

This causes the bug because the input action that lets P2 take control of the frontend uses the Menu input mode. If P2 is dormant and in the Game input mode then P2 can never be taken out of dormancy (at least in the Frontend). Ekberg tried the solution in  where we change the ActionDomainTable itself to default to Menu in CL24329718  but it looks like that one had some unfortunate side effects in StW :(

For this approach, we default that player's action router input mode back to default when the root layout is dormant so that P2 is in the Menu input mode when in the Frontend after returning from the game and is not switched out of it by a rogue refresh.

Also I wanted to use the ROLLBACK macro here but this is an Engine plugin while rollbacks are FortniteGame :(

[REVIEW] [at]michael.mackie [at]saad.nader [at]michael.ekberg [at]fn-pj-eng
#tests tested the PS4 flow with the cvar on and off to confirm the fix works and doesn't break anything else

[CL 25382963 by jan orlowski in ue5-main branch]
2023-05-08 22:04:57 -04:00
..