From 9ae059db1b8c71e0249578748b90e4b43c5a09d7 Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Sun, 4 Oct 2026 00:12:03 +0200 Subject: [PATCH] save the connection with the session collect_layout() now reports the multicast group and interface the app was launched with, so a stored session says how to reach its source and not just which host and port it was. --- src/ui.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ui.cpp b/src/ui.cpp index 3058a81..22331f5 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -266,6 +266,11 @@ struct App { /// CONFIG arrived. std::string source_host; std::uint16_t source_port = 0; + /// How that source was reached. Unused at runtime -- `Acquisition` has its own copy -- but + /// written into the session file, because `_.toml` can say neither, and the startup + /// chooser needs both to reconnect to a multicast source from a stored row. + std::string source_multicast; + std::string source_interface; guint layout_save_source = 0; bool layout_loaded = false; unsigned signal_generation = ~0u; @@ -558,6 +563,9 @@ LayoutState collect_layout(App& app) { // The app's own lists are the pane's source of truth for both of these. st.math = app.math; st.measures = app.measures; + // The connection is the session's too: the file's name carries only host and port. + st.multicast = app.source_multicast; + st.interface_addr = app.source_interface; return st; } @@ -7159,6 +7167,8 @@ int run_ui(int argc, char** argv, const Config& cfg, ScopeModel& model, Acquisit // Which data source this session talks to: the persisted-layout file's name. app.source_host = cfg.server; app.source_port = cfg.port; + app.source_multicast = cfg.multicast; + app.source_interface = cfg.interface_addr; GtkApplication* application = // `NON_UNIQUE`: a scope is the kind of program a user runs twice side by side -- one