From 9357a6cb8802b3d57a6c140a3d9a9a2068403089 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Sat, 15 May 2021 16:38:00 +0100 Subject: [PATCH] network: Start the module with some text in the label_ Fix modules starting with no text, but not hidding. Start with some "text" in the module's label_, update() will then update it. Since the text should be different, update() will be able to show or hide the event_box_. This is to work around the case where the module start with no text, but the the event_box_ is shown. --- src/modules/network.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/network.cpp b/src/modules/network.cpp index 8dcfb57..e52ed02 100644 --- a/src/modules/network.cpp +++ b/src/modules/network.cpp @@ -93,6 +93,13 @@ waybar::modules::Network::Network(const std::string &id, const Json::Value &conf rfkill_{RFKILL_TYPE_WLAN}, #endif frequency_(0) { + + // Start with some "text" in the module's label_, update() will then + // update it. Since the text should be different, update() will be able + // to show or hide the event_box_. This is to work around the case where + // the module start with no text, but the the event_box_ is shown. + label_.set_markup(""); + auto down_octets = read_netstat(BANDWIDTH_CATEGORY, BANDWIDTH_DOWN_TOTAL_KEY); auto up_octets = read_netstat(BANDWIDTH_CATEGORY, BANDWIDTH_UP_TOTAL_KEY); if (down_octets) {