fix(mpris): defer widget visibility to update() to stop resume SIGSEGV

The name-vanished playerctl callback called event_box_.set_visible(false)
directly. On resume from suspend this runs in a re-entrant / torn-down
state and crashes in Gtk::Widget::set_visible. Only clear the player and
dp.emit() from the callback; update() (on the main thread) computes
visibility from player state and hides the module when there is no player,
matching the other hardened handlers.

Fixes #5124.
This commit is contained in:
Alex
2026-07-04 13:04:04 +02:00
parent 8664d9a963
commit c19abf373b
+4 -1
View File
@@ -406,8 +406,11 @@ auto Mpris::onPlayerNameVanished(PlayerctlPlayerManager* manager, PlayerctlPlaye
if (mpris->player_ == "playerctld") {
mpris->dp.emit();
} else if (mpris->player_ == player_name->name) {
// Don't touch GTK widgets directly from the playerctl callback: on resume
// from suspend this can run in a re-entrant / torn-down state and crash in
// Gtk::Widget::set_visible. Only update state + emit; update() (on the main
// thread) hides the module when there is no player. See #5124.
mpris->player = nullptr;
mpris->event_box_.set_visible(false);
mpris->dp.emit();
}
}