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:
@ -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");
|
||||
|
||||
Reference in New Issue
Block a user