From 1c14c0401ea58ffbeee1d4fa94472c7e21bc87aa Mon Sep 17 00:00:00 2001 From: NeilClack Date: Thu, 13 Aug 2026 16:18:51 -0500 Subject: [PATCH] Fix: Main Menu footer shows 'WiFi Not Connected' Updated WiFiDevice::getActiveAccessPoint() to read the AP's SSID so connectedSSID() can report which network is in use. --- src/network/nm_device.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/network/nm_device.cpp b/src/network/nm_device.cpp index 59ff31a..a6af2f7 100644 --- a/src/network/nm_device.cpp +++ b/src/network/nm_device.cpp @@ -358,10 +358,34 @@ AccessPointInfo WifiDevice::getActiveAccessPoint() const { return AccessPointInfo{}; // No active AP } - // Would need to fetch AP properties here - // For now, return basic info AccessPointInfo ap; ap.object_path = ap_path; + + // Read the active AP's SSID bytes so connectedSSID() (and the Home footer) + // can report which network is in use. + sd_bus_message* ssid_msg = nullptr; + sd_bus_error ssid_error = SD_BUS_ERROR_NULL; + int r = sd_bus_get_property( + impl_->bus, + "org.freedesktop.NetworkManager", + ap_path, + "org.freedesktop.NetworkManager.AccessPoint", + "Ssid", + &ssid_error, + &ssid_msg, + "ay" + ); + if (r >= 0 && ssid_msg) { + const uint8_t* ssid_data = nullptr; + size_t ssid_len = 0; + r = sd_bus_message_read_array(ssid_msg, 'y', (const void**)&ssid_data, &ssid_len); + if (r >= 0 && ssid_data && ssid_len > 0) { + ap.ssid = std::string(reinterpret_cast(ssid_data), ssid_len); + } + sd_bus_message_unref(ssid_msg); + } + sd_bus_error_free(&ssid_error); + return ap; }