UCommonInputPlatformSettings::InitializeControllerData() does not run early and triggers a LoadSynchronous() when related CommonActionWidget is used

Hi,

This issue was called out a while ago in this post:

[Content removed]

And the response was that UCommonInputPlatformSettings::InitializeControllerData() should be called very early in the game’s lifetime and so shouldn’t trigger whilst the player is in control.

However if you run a vanilla Lyra project in UE 5.6 in PIE, with a breakpoint in UCommonInputPlatformSettings::InitializeControllerData(), you will find that it first triggers in UCommonActionWidget::GetIcon() when loading the front-end UI.

It looks like it should be first run via UCommonInputPlatformSettings::PostLoad(), but nothing appears to call that.

In our project we have asserts to ensure that we’re not doing any async flushes to loading when the loading screen isn’t up, which is how we discovered this issue.

Thanks,

Dave

Steps to Reproduce

  1. Create a vanilla Lyra project in UE 5.6.
  2. Set breakpoints in UCommonInputPlatformSettings::InitializeControllerData() and UCommonInputPlatformSettings::PostLoad().
  3. Run the project/editor from an IDE.
  4. Open the L_LyraFrontEnd level.
  5. Run PIE

Observe that PostLoad doesn’t trigger and that InitializeControllerData() first triggers in UCommonActionWidget::GetIcon() when loading the front-end UI.

InitializeControllerData() contains a LoadSynchronous() which will flush any async loads.

Hello,

Sorry for the delay, I was indeed able to easily repro the issue thanks to your steps, and to fix it.

The fix will be part of UE 5.7, and it’s only one line, so I can share it here.

In PlatformSettingsManager.cpp, in the method UPlatformSettingsManager::CreateSettingsObjectForPlatform, replace

PlatformSettingsForThisClass->LoadConfig();by

PlatformSettingsForThisClass->PostLoad();It will still load the config from inside PostLoad, but also call the PostLoad method that was expecting to be called.

Thanks,

Yohann

[mention removed]​ It seems the solution posted here has been reverted [[Backout] - CL44608639 · EpicGames/UnrealEngine[Content removed] so I’d say don’t use this solution just yet as it may have some negative consequences.

[mention removed]​ [mention removed]​ Yes, I confirm, an issue with the fix was detected, please don’t use it right now…

This issue hasn’t been resolved yet, so this has been closed in error.

The close was a bit too fast!

But I submitted an updated version of the fix, it will be available in UE 5.7.

For ref: https://github.com/EpicGames/UnrealEngine/commit/0d2723e5a1f582227c4b7151e513248bafe72507

Great - thanks a lot!