mirror of
https://github.com/Alexays/Waybar.git
synced 2026-08-18 11:07:06 +00:00
2190871a(perf(label): skip redundant markup updates) caches the last label/tooltip markup as Glib::ustring and skips set_markup() when the new markup compares equal. Glib::ustring::operator== goes through g_utf8_collate(), and under the UTF-8 locale GTK sets at startup, Unicode private-use codepoints carry no collation weight. All nerd-font icons live in the PUA, so two labels that differ only in their icon glyph collate as equal and the visual update is silently dropped. idle_inhibitor is the visible victim (#5169): clicking toggles the state class (highlight changes) but the {icon} glyph never switches between the activated/deactivated icons, while plain-text icons like "YES"/"NO" work. Any ALabel module whose consecutive updates differ only by a PUA glyph is affected. The module only started routing through this cache whendb4941efmigrated it onto the shared setLabelMarkup()/setTooltipMarkup() helpers, which is why it broke in the latest batch of refactors. Store the cache as raw UTF-8 bytes (std::string via ustring::raw()) and compare those instead, so the skip only triggers on byte-identical markup. Reproduced and verified under a nested niri session: before the fix RTMIN+n toggled the state class but left the sleep glyph unchanged; after it the glyph flips as expected, and byte-identical updates are still skipped.