From c19abf373bceb3eb264690f94d367407d7133568 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 4 Jul 2026 12:58:45 +0200 Subject: [PATCH] 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. --- src/modules/mpris/mpris.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/mpris/mpris.cpp b/src/modules/mpris/mpris.cpp index 7eb11594..387e0597 100644 --- a/src/modules/mpris/mpris.cpp +++ b/src/modules/mpris/mpris.cpp @@ -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(); } }