From 49c305e814af7db1e15fe7083bf2de4d134089f5 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 27 Jul 2026 10:40:39 +0800 Subject: [PATCH] Reconnect selected printer when switching back to BBL printer agent --- src/slic3r/GUI/GUI_App.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 07e99348bb..8350fe4e65 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3935,9 +3935,17 @@ void GUI_App::switch_printer_agent() void GUI_App::select_machine(const std::string& agent_id) { - // Skip for BBL agent for now - uses its own device discovery/selection - // Orca todo: revisit in future if we want to support auto-switching for BBL printers + // The BBL agent uses its own device discovery/selection, so don't auto-switch. + // But swapping agents disconnected its printer link (NetworkAgent::set_printer_agent), + // so when it becomes active again re-select the machine; the same-dev_id paths in + // DeviceManager::set_selected_machine re-establish the LAN MQTT session (lan) or + // refresh the subscription (cloud). if (agent_id == BBL_PRINTER_AGENT_ID) { + if (m_device_manager) { + MachineObject* sel = m_device_manager->get_selected_machine(); + if (sel) + m_device_manager->set_selected_machine(sel->get_dev_id()); + } return; }