diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2022-07-13 15:22:40 -0700 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2022-07-13 15:23:00 -0700 |
| commit | 25aa30ac6918a4726195140fa0fdb404dec07130 (patch) | |
| tree | 437d2f2e83f73c681bd434208d509e0a18c614f5 /Source/Core/DolphinQt/Config/FreeLookWidget.cpp | |
| parent | 5663a44962580fb9d069fc29d9247f78c440cf39 (diff) | |
Free Look: Add background input setting (disabled by default)
Before, Free Look would accept background input by default, which means it was easy to accidentally move the camera while typing in another window. (This is because HotkeyScheduler::Run sets the input gate to `true` after it's copied the hotkey state, supposedly for other threads (though `SetInputGate` uses a `thread_local` variable so I'm not 100% sure that's correct) and for the GBA windows (which always accept unfocused input, presumably because they won't be focused normally).
Diffstat (limited to 'Source/Core/DolphinQt/Config/FreeLookWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Config/FreeLookWidget.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/Config/FreeLookWidget.cpp b/Source/Core/DolphinQt/Config/FreeLookWidget.cpp index 8ef725e1d0..87c204b667 100644 --- a/Source/Core/DolphinQt/Config/FreeLookWidget.cpp +++ b/Source/Core/DolphinQt/Config/FreeLookWidget.cpp @@ -61,6 +61,9 @@ void FreeLookWidget::CreateLayout() description->setTextInteractionFlags(Qt::TextBrowserInteraction); description->setOpenExternalLinks(true); + m_freelook_background_input = new QCheckBox(tr("Background Input")); + m_freelook_background_input->setChecked(Config::Get(Config::FREE_LOOK_BACKGROUND_INPUT)); + auto* hlayout = new QHBoxLayout(); hlayout->addWidget(new QLabel(tr("Camera 1"))); hlayout->addWidget(m_freelook_control_type); @@ -68,6 +71,7 @@ void FreeLookWidget::CreateLayout() layout->addWidget(m_enable_freelook); layout->addLayout(hlayout); + layout->addWidget(m_freelook_background_input); layout->addWidget(description); setLayout(layout); @@ -78,6 +82,7 @@ void FreeLookWidget::ConnectWidgets() connect(m_freelook_controller_configure_button, &QPushButton::clicked, this, &FreeLookWidget::OnFreeLookControllerConfigured); connect(m_enable_freelook, &QCheckBox::clicked, this, &FreeLookWidget::SaveSettings); + connect(m_freelook_background_input, &QCheckBox::clicked, this, &FreeLookWidget::SaveSettings); connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] { const QSignalBlocker blocker(this); LoadSettings(); @@ -101,12 +106,16 @@ void FreeLookWidget::LoadSettings() m_enable_freelook->setChecked(checked); m_freelook_control_type->setEnabled(checked); m_freelook_controller_configure_button->setEnabled(checked); + m_freelook_background_input->setEnabled(checked); } void FreeLookWidget::SaveSettings() { const bool checked = m_enable_freelook->isChecked(); Config::SetBaseOrCurrent(Config::FREE_LOOK_ENABLED, checked); + Config::SetBaseOrCurrent(Config::FREE_LOOK_BACKGROUND_INPUT, + m_freelook_background_input->isChecked()); m_freelook_control_type->setEnabled(checked); m_freelook_controller_configure_button->setEnabled(checked); + m_freelook_background_input->setEnabled(checked); } |
