From abe1fa5bd41db67058a6a9606efcc9b4c1f99e14 Mon Sep 17 00:00:00 2001 From: Jordan Leppert Date: Sat, 31 Oct 2020 12:21:51 +0000 Subject: [PATCH] Custom module - only call label_.set_tooltip_markup if tooltip markup has actually changed - fixes tooltips not appearing at all if a custom module is updating too frequently. --- src/modules/custom.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 92eedaaa..ba55edd5 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -131,9 +131,13 @@ auto waybar::modules::Custom::update() -> void { label_.set_markup(str); if (tooltipEnabled()) { if (text_ == tooltip_) { - label_.set_tooltip_markup(str); + if (label_.get_tooltip_markup() != str) { + label_.set_tooltip_markup(str); + } } else { - label_.set_tooltip_markup(tooltip_); + if (label_.get_tooltip_markup() != tooltip_) { + label_.set_tooltip_markup(tooltip_); + } } } auto classes = label_.get_style_context()->list_classes();