CommonHostInterface: Move input map update to frontend

Fixes controller state getting reset when loading input profile.
This commit is contained in:
Connor McLaughlin 2021-01-09 14:54:52 +10:00
parent ad0d16e243
commit 4fafb34251
3 changed files with 12 additions and 7 deletions

View File

@ -822,6 +822,7 @@ bool AndroidHostInterface::ApplyInputProfile(const char* profile_name)
Assert(!IsEmulationThreadRunning() || IsEmulationThreadPaused());
CommonHostInterface::ApplyInputProfile(path.c_str(), m_settings_interface);
ApplySettings(false);
return true;
}

View File

@ -767,8 +767,17 @@ void QtHostInterface::applyInputProfile(const QString& profile_path)
return;
}
std::lock_guard<std::recursive_mutex> lock(m_settings_mutex);
ApplyInputProfile(profile_path.toUtf8().data(), *m_settings_interface.get());
Settings old_settings(std::move(g_settings));
{
std::lock_guard<std::recursive_mutex> lock(m_settings_mutex);
CommonHostInterface::ApplyInputProfile(profile_path.toUtf8().data(), *m_settings_interface.get());
CommonHostInterface::LoadSettings(*m_settings_interface.get());
CommonHostInterface::ApplyGameSettings(false);
CommonHostInterface::FixIncompatibleSettings(false);
}
CheckForSettingsChanges(old_settings);
emit inputProfileLoaded();
}

View File

@ -1880,11 +1880,6 @@ void CommonHostInterface::ApplyInputProfile(const char* profile_path, SettingsIn
}
}
if (System::IsValid())
System::UpdateControllers();
UpdateInputMap(si);
ReportFormattedMessage(TranslateString("OSDMessage", "Loaded input profile from '%s'"), profile_path);
}