diff options
Diffstat (limited to 'Source/Core/DolphinWX/InputConfigDiag.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/InputConfigDiag.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp index 49d58d4ce3..e47e2776ed 100644 --- a/Source/Core/DolphinWX/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/InputConfigDiag.cpp @@ -492,6 +492,7 @@ void ControlDialog::DetectControl(wxCommandEvent& event) ciface::Core::Device* const dev = g_controller_interface.FindDevice(m_devq); if (dev) { + m_event_filter.BlockEvents(true); btn->SetLabel(_("[ waiting ]")); // This makes the "waiting" text work on Linux. true (only if needed) prevents crash on Windows @@ -504,6 +505,10 @@ void ControlDialog::DetectControl(wxCommandEvent& event) SelectControl(ctrl->GetName()); btn->SetLabel(lbl); + + // This lets the input events be sent to the filter and discarded before unblocking + wxTheApp->Yield(true); + m_event_filter.BlockEvents(false); } } @@ -531,6 +536,7 @@ bool GamepadPage::DetectButton(ControlButton* button) ciface::Core::Device* const dev = g_controller_interface.FindDevice(controller->default_device); if (dev) { + m_event_filter.BlockEvents(true); button->SetLabel(_("[ waiting ]")); // This makes the "waiting" text work on Linux. true (only if needed) prevents crash on Windows @@ -548,6 +554,10 @@ bool GamepadPage::DetectButton(ControlButton* button) g_controller_interface.UpdateReference(button->control_reference, controller->default_device); success = true; } + + // This lets the input events be sent to the filter and discarded before unblocking + wxTheApp->Yield(true); + m_event_filter.BlockEvents(false); } UpdateGUI(); @@ -1072,3 +1082,14 @@ InputConfigDialog::InputConfigDialog(wxWindow* const parent, InputConfig& config Bind(wxEVT_TIMER, &InputConfigDialog::UpdateBitmaps, this); m_update_timer.Start(PREVIEW_UPDATE_TIME, wxTIMER_CONTINUOUS); } + +int InputEventFilter::FilterEvent(wxEvent& event) +{ + if (m_block && ShouldCatchEventType(event.GetEventType())) + { + event.StopPropagation(); + return Event_Processed; + } + + return Event_Skip; +} |
