diff --git a/include/ALabel.hpp b/include/ALabel.hpp index 201d640c..3e3690b1 100644 --- a/include/ALabel.hpp +++ b/include/ALabel.hpp @@ -87,8 +87,11 @@ class ALabel : public AModule { static void handleGtkMenuEvent(GtkMenuItem* menuitem, gpointer data); private: - std::optional last_label_markup_; - std::optional last_tooltip_markup_; + // Raw UTF-8 bytes, not Glib::ustring: ustring::operator== collates with + // g_utf8_collate(), which gives private-use codepoints (nerd-font icons) + // no collation weight, so two different icons compare equal. + std::optional last_label_markup_; + std::optional last_tooltip_markup_; }; } // namespace waybar diff --git a/src/ALabel.cpp b/src/ALabel.cpp index 84ac2052..752c80bd 100644 --- a/src/ALabel.cpp +++ b/src/ALabel.cpp @@ -147,22 +147,22 @@ ALabel::ALabel(const Json::Value& config, const std::string& name, const std::st auto ALabel::update() -> void { AModule::update(); } bool ALabel::setLabelMarkup(const Glib::ustring& markup) { - if (last_label_markup_ == markup) { + if (last_label_markup_ == markup.raw()) { return false; } label_.set_markup(markup); - last_label_markup_ = markup; + last_label_markup_ = markup.raw(); return true; } bool ALabel::setTooltipMarkup(const Glib::ustring& markup) { - if (last_tooltip_markup_ == markup) { + if (last_tooltip_markup_ == markup.raw()) { return false; } label_.set_tooltip_markup(markup); - last_tooltip_markup_ = markup; + last_tooltip_markup_ = markup.raw(); return true; }