From b045b6dc4bb9ed07063a13f6013aff5a42222e09 Mon Sep 17 00:00:00 2001 From: Arlieeee Date: Thu, 22 Jan 2026 15:10:51 +0800 Subject: [PATCH] Implement macOS cold start fix in GUI_App to store URL for post-initialization handling, ensuring consistent behavior with Windows. --- src/slic3r/GUI/GUI_App.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 9093f35e..f4d2ce7f 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -10317,6 +10317,18 @@ void GUI_App::MacOpenURL(const wxString& url) { if (url.empty()) return; + + // Fix for macOS cold start: If not yet post-initialized, store the URL in + // init_params->input_files so that post_init() will detect it and set + // switch_to_3d = true. This prevents trigger_restore_project() from calling + // new_project() which would clear the model that will be loaded from this URL. + // This makes macOS behavior consistent with Windows. + if (!m_post_initialized) { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": cold start detected, storing URL to init_params: " << url.ToStdString(); + this->init_params->input_files.emplace_back(into_u8(url)); + return; // post_init() will call start_download() for us + } + start_download(boost::nowide::narrow(url)); }