From 00d274fc290f792847ba662fe0d4e9d585710686 Mon Sep 17 00:00:00 2001 From: tao wang Date: Wed, 6 Nov 2024 11:39:41 +0800 Subject: [PATCH] FIX:fixed that macOS will hang up as direct connected device jira:[STUDIO-8630] Change-Id: I96562bd11de807435fc6a2d81501800b0cf110b1 (cherry picked from commit c8a8d9f19758a33d713054eb93cd5084b38ac26a) --- src/slic3r/GUI/ReleaseNote.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 99faf79775..619c6e25f5 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -1892,8 +1892,7 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt) Refresh(); Layout(); Fit(); - - m_thread = new boost::thread(boost::bind(&InputIpAddressDialog::workerThreadFunc, this, str_ip, str_access_code, str_sn, str_model_id)); + m_thread = new boost::thread(boost::bind(&InputIpAddressDialog::workerThreadFunc, this, str_ip, str_access_code, str_sn, str_model_id)); } void InputIpAddressDialog::update_test_msg_event(wxCommandEvent& evt) @@ -1921,7 +1920,13 @@ void InputIpAddressDialog::workerThreadFunc(std::string str_ip, std::string str_ detectResult detectData; auto result = -1; if (current_input_index == 0) { + +#ifdef __APPLE__ + result = -3; +#else result = wxGetApp().getAgent()->bind_detect(str_ip, "secure", detectData); +#endif + } else { result = 0; detectData.dev_name = sn; @@ -1973,8 +1978,13 @@ void InputIpAddressDialog::workerThreadFunc(std::string str_ip, std::string str_ post_update_test_msg(wxEmptyString, true); post_update_test_msg(wxString::Format(_L("Connecting to printer... The dialog will close later"), closeCount), true); - + +#ifdef __APPLE__ + wxCommandEvent event(EVT_CLOSE_IPADDRESS_DLG); + wxPostEvent(this, event); +#else closeTimer->Start(1000); +#endif } void InputIpAddressDialog::OnTimer(wxTimerEvent& event) {