InputCommon: Make the "input gate" not racey.

This commit is contained in:
Jordan Woyak
2019-11-06 15:59:36 -06:00
parent 93d7b3d159
commit 85ceb37ccd
17 changed files with 32 additions and 63 deletions

View File

@ -25,7 +25,6 @@
#include "DolphinQt/Config/Mapping/MappingWidget.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/Settings.h"
namespace
{
@ -567,9 +566,6 @@ void MappingIndicator::DrawForce(ControllerEmu::Force& force)
void MappingIndicator::paintEvent(QPaintEvent*)
{
// TODO: The SetControllerStateNeeded interface leaks input into the game.
Settings::Instance().SetControllerStateNeeded(true);
switch (m_group->type)
{
case ControllerEmu::GroupType::Cursor:
@ -588,8 +584,6 @@ void MappingIndicator::paintEvent(QPaintEvent*)
default:
break;
}
Settings::Instance().SetControllerStateNeeded(false);
}
ShakeMappingIndicator::ShakeMappingIndicator(ControllerEmu::Shake* group)
@ -599,9 +593,7 @@ ShakeMappingIndicator::ShakeMappingIndicator(ControllerEmu::Shake* group)
void ShakeMappingIndicator::paintEvent(QPaintEvent*)
{
Settings::Instance().SetControllerStateNeeded(true);
DrawShake();
Settings::Instance().SetControllerStateNeeded(false);
}
void ShakeMappingIndicator::DrawShake()

View File

@ -14,7 +14,6 @@
#include "DolphinQt/Config/Mapping/MappingIndicator.h"
#include "DolphinQt/Config/Mapping/MappingNumeric.h"
#include "DolphinQt/Config/Mapping/MappingWindow.h"
#include "DolphinQt/Settings.h"
#include "InputCommon/ControlReference/ControlReference.h"
#include "InputCommon/ControllerEmu/Control/Control.h"
@ -31,11 +30,8 @@ MappingWidget::MappingWidget(MappingWindow* parent) : m_parent(parent)
const auto timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, [this] {
// TODO: The SetControllerStateNeeded interface leaks input into the game.
const auto lock = m_parent->GetController()->GetStateLock();
Settings::Instance().SetControllerStateNeeded(true);
emit Update();
Settings::Instance().SetControllerStateNeeded(false);
});
timer->start(1000 / INDICATOR_UPDATE_FREQ);