From 9c3a591db83170e73413b61141f1d3fdc7baaf85 Mon Sep 17 00:00:00 2001 From: CLARATION Date: Sat, 1 Aug 2026 18:59:47 -0700 Subject: [PATCH] fix(wx): remove disconnects handling during dfu transition when the text "device has entered dfu" appeared, theres a 3 second window where it waits until it transitions to the exploit screen, and during that moment device disconnect handling was being incorrectly handled when it shouldnt of been --- src/wx/DfuPanel.cpp | 7 ++++++- src/wx/DfuPanel.hpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wx/DfuPanel.cpp b/src/wx/DfuPanel.cpp index 3ae886e..3763bf7 100644 --- a/src/wx/DfuPanel.cpp +++ b/src/wx/DfuPanel.cpp @@ -160,6 +160,7 @@ void DfuPanel::SetDeviceState(const DeviceState& state) m_index = m_sequence.steps.size(); m_stepRemaining = -1; m_actionExecutedIndex = -1; + m_waitingForDfuTransition = true; const wxColour inactive = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT); @@ -191,8 +192,11 @@ void DfuPanel::SetDeviceState(const DeviceState& state) GetMainFrame()->ShowMain(); } - if (!m_isEnteringDfu && !state.connected) + if (!state.connected) { + if (m_isEnteringDfu || m_waitingForDfuTransition) + return; + m_isEnteringDfu = false; m_backButton->Enable(); m_startButton->Enable(); @@ -362,6 +366,7 @@ void DfuPanel::StartSequence(const DfuSequence& seq) m_index = 0; m_stepRemaining = -1; m_actionExecutedIndex = -1; + m_waitingForDfuTransition = false; RunStep(); } diff --git a/src/wx/DfuPanel.hpp b/src/wx/DfuPanel.hpp index 63b453e..4b603d4 100644 --- a/src/wx/DfuPanel.hpp +++ b/src/wx/DfuPanel.hpp @@ -62,6 +62,7 @@ private: wxTimer m_timer; wxTimer m_stagnentTimer; bool m_isEnteringDfu = false; + bool m_waitingForDfuTransition = false; wxPanel* m_devicePanel = nullptr; wxStaticBitmap* m_deviceImage = nullptr;