Fix Pango NULL layout crash by clearing markup before hiding label

Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-04 08:54:32 +00:00
parent 2c3aab88de
commit 03de38b4d0

View File

@ -47,9 +47,11 @@ auto waybar::modules::cava::Cava::onSilence() -> void {
if (label_.get_style_context()->has_class("updated"))
label_.get_style_context()->remove_class("updated");
if (hide_on_silence_)
if (hide_on_silence_) {
// Clear the label markup before hiding to prevent GTK from rendering a NULL Pango layout
label_.set_markup("");
label_.hide();
else if (config_["format_silent"].isString())
} else if (config_["format_silent"].isString())
label_.set_markup(format_silent_);
silence_ = true;
label_.get_style_context()->add_class("silent");