From bb190409deeef4a5885c8d190ff6059867c623cc Mon Sep 17 00:00:00 2001 From: Erik Alonso Date: Mon, 21 Jul 2025 19:04:37 +0100 Subject: [PATCH] fix: unable to disable upower's tooltip --- src/modules/upower.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/upower.cpp b/src/modules/upower.cpp index 4b832b7e..4844582f 100644 --- a/src/modules/upower.cpp +++ b/src/modules/upower.cpp @@ -10,7 +10,6 @@ UPower::UPower(const std::string &id, const Json::Value &config) : AIconLabel(config, "upower", id, "{percentage}", 0, true, true, true), sleeping_{false} { box_.set_name(name_); box_.set_spacing(0); - box_.set_has_tooltip(AModule::tooltipEnabled()); // Tooltip box contentBox_.set_orientation((box_.get_orientation() == Gtk::ORIENTATION_HORIZONTAL) ? Gtk::ORIENTATION_VERTICAL @@ -70,8 +69,10 @@ UPower::UPower(const std::string &id, const Json::Value &config) g_signal_connect(upClient_, "device-removed", G_CALLBACK(deviceRemoved_cb), this); // Subscribe tooltip query events - box_.set_has_tooltip(); - box_.signal_query_tooltip().connect(sigc::mem_fun(*this, &UPower::queryTooltipCb), false); + box_.set_has_tooltip(AModule::tooltipEnabled()); + if (AModule::tooltipEnabled()) { + box_.signal_query_tooltip().connect(sigc::mem_fun(*this, &UPower::queryTooltipCb), false); + } resetDevices(); setDisplayDevice();