You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the ignored-players configuration option in the MPRIS module, if one of the ignored players starts playing, the waybar display of the currently active player disappears, even if the current player is not in the ignored list.
Steps to Reproduce
Configure waybar with MPRIS module using ignored-players
Start playing media in a non-ignored player (e.g., spotify)
While spotify is playing, start playing media in firefox
Observe that the spotify display in waybar disappears
Expected Behavior
When an ignored player starts playing, the current non-ignored player should remain displayed
The widget should only disappear when:
Using playerctld and all active players are in the ignored list
Using a specific player that is in the ignored list
Actual Behavior
The display disappears completely when any ignored player starts playing, regardless of whether there are active non-ignored players.
Suggested Root Cause from Claude
In the getPlayerInfo() method, when using playerctld, the code immediately returns nullopt if the first active player is in the ignored list, without checking for other non-ignored active players.
Proposed fix
autoMpris::getPlayerInfo() -> std::optional<PlayerInfo> {
if (!player) {
return std::nullopt;
}
GError* error = nullptr;
waybar::util::ScopeGuard error_deleter([error]() {
if (error) {
g_error_free(error);
}
});
char* player_status = nullptr;
auto player_playback_status = PLAYERCTL_PLAYBACK_STATUS_STOPPED;
g_object_get(player, "status", &player_status, "playback-status", &player_playback_status, NULL);
std::string player_name = player_;
if (player_name == "playerctld") {
GList* players = playerctl_list_players(&error);
if (error) {
throwstd::runtime_error(fmt::format("unable to list players: {}", error->message));
}
// > get the list of players [..] in order of activity// https://github.com/altdesktop/playerctl/blob/b19a71cb9dba635df68d271bd2b3f6a99336a223/playerctl/playerctl-common.c#L248-L249
players = g_list_first(players);
// Find the first non-ignored playerwhile (players) {
player_name = static_cast<PlayerctlPlayerName*>(players->data)->name;
if (std::none_of(ignored_players_.begin(), ignored_players_.end(),
[&](const std::string& pn) { return player_name == pn; })) {
break;
}
players = g_list_next(players);
}
// If all players are ignored, return nulloptif (!players) {
spdlog::debug("mpris: all active players are ignored");
return std::nullopt;
}
} else {
// For specific player selection, respect ignored_playersif (std::any_of(ignored_players_.begin(), ignored_players_.end(),
[&](const std::string& pn) { return player_name == pn; })) {
spdlog::warn("mpris[{}]: ignoring player update", player_name);
return std::nullopt;
}
}
// make status lowercase
player_status[0] = std::tolower(player_status[0]);
PlayerInfo info = {
.name = player_name,
.status = player_playback_status,
.status_string = player_status,
.artist = std::nullopt,
.album = std::nullopt,
.title = std::nullopt,
.length = std::nullopt,
};
Environment
Waybar version: 0.11.0
OS: Arch Linux
The text was updated successfully, but these errors were encountered:
Description
When using the
ignored-players
configuration option in the MPRIS module, if one of the ignored players starts playing, the waybar display of the currently active player disappears, even if the current player is not in the ignored list.Steps to Reproduce
ignored-players
Expected Behavior
playerctld
and all active players are in the ignored listActual Behavior
The display disappears completely when any ignored player starts playing, regardless of whether there are active non-ignored players.
Suggested Root Cause from Claude
In the
getPlayerInfo()
method, when usingplayerctld
, the code immediately returnsnullopt
if the first active player is in the ignored list, without checking for other non-ignored active players.Proposed fix
Environment
The text was updated successfully, but these errors were encountered: