From bcf852146cace9dacf371910019f36a7cea36a20 Mon Sep 17 00:00:00 2001 From: kylin-liwn Date: Thu, 17 Sep 2026 17:31:25 +0800 Subject: [PATCH] fix(load): respect tooltip-format config The load module called label_.set_tooltip_markup() with a hardcoded format. It never called resolveTooltipFormat(), so the user's tooltip-format config was silently ignored. Replace the direct call with setTooltipMarkup() paired with resolveTooltipFormat(). Use the configured format when present, fall back to the original default. --- src/modules/load.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/load.cpp b/src/modules/load.cpp index 7262740576..57b918bd06 100644 --- a/src/modules/load.cpp +++ b/src/modules/load.cpp @@ -20,10 +20,7 @@ waybar::modules::Load::Load(const std::string& id, const Json::Value& config) auto waybar::modules::Load::update() -> void { // TODO: as creating dynamic fmt::arg arrays is buggy we have to calc both auto [load1, load5, load15] = Load::getLoad(); - if (tooltipEnabled()) { - auto tooltip = fmt::format("Load 1: {}\nLoad 5: {}\nLoad 15: {}", load1, load5, load15); - label_.set_tooltip_markup(tooltip); - } + auto default_tooltip = fmt::format("Load 1: {}\nLoad 5: {}\nLoad 15: {}", load1, load5, load15); auto format = format_; auto state = getState(load1); if (!state.empty() && config_["format-" + state].isString()) { @@ -43,6 +40,9 @@ auto waybar::modules::Load::update() -> void { store.push_back(fmt::arg("icon5", getIcon(load5, icons))); store.push_back(fmt::arg("icon15", getIcon(load15, icons))); label_.set_markup(fmt::vformat(format, store)); + if (tooltipEnabled()) { + setTooltipMarkup(fmt::vformat(resolveTooltipFormat(default_tooltip, state), store)); + } } // Call parent update