From 8b60291ed9651cf6cd79aa8ee5bcbecbdad07662 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 18 Jul 2026 15:16:15 +0800 Subject: [PATCH] Restart printer discovery after a network-plugin hot reload restart_networking() rebuilds m_agent with a null printer agent, so the bare m_agent->start_discovery() no-oped (NetworkAgent::start_discovery returns false when m_printer_agent is null) and LAN discovery stayed dead until the user next changed a preset. Call switch_printer_agent() instead - it installs the printer agent for the active preset and then starts discovery, mirroring startup. --- src/slic3r/GUI/GUI_App.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 0714325c07..6d0b66ec01 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1677,7 +1677,13 @@ void GUI_App::restart_networking() m_agent->set_on_http_error_fn([this](CloudEvent event, unsigned int status, std::string body) { this->handle_http_error(status, body, event.provider); }); - m_agent->start_discovery(true, false); + // on_init_network() rebuilt m_agent with a null printer agent, so calling + // m_agent->start_discovery() directly would no-op (NetworkAgent::start_discovery + // returns false when m_printer_agent is null). Re-establish the printer agent for the + // active preset first - switch_printer_agent() installs it and then starts discovery, + // mirroring startup - otherwise LAN discovery stays dead after a plugin hot reload + // until the user next changes a preset/tab. + switch_printer_agent(); if (mainframe) mainframe->refresh_plugin_tips(); if (plater_)