Skip to content

Keep the chosen media player when another paused player holds a stream - #20775

Closed
crmne wants to merge 1 commit into
omacom:quattrofrom
crmne:fix/media-player-selection
Closed

crmne wants to merge 1 commit into
omacom:quattrofrom
crmne:fix/media-player-selection

Conversation

@crmne

@crmne crmne commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

What changes

Fixes #17668, and the part of #12772 where a player was explicitly chosen.

When nothing is playing, MediaModel.idlePlayer() ranked any player holding a PipeWire stream above the player the user last chose. Chromium and Spotify keep a paused stream open, so clicking another paused player in the media popup, or using a media key on it, left the stream holder selected, and Play resumed it.

  • idlePlayer() now puts the preferred player first. The stream, track, controllable and identity fallbacks are unchanged when nothing is preferred.
  • The preference now lapses when another player starts playing (startedOtherPlayer(), checked in syncPlayingOrder()). Without this, a pick from hours ago would outrank a player used since; with it, that case falls back to today's ordering. The playerctld proxy does not count, and a player that was already playing when the pick was made does not either.

Not covered here: with no preference at all (both players driven from their own UI), the stream holder still wins, and the preference does not survive a shell restart or a player re-registering its MPRIS object. Those need a recency signal or persisted state, which #9201 and #12772 discuss.

Verification

  • bash test/shell.d/media-test.sh passes. On quattro without the fix it fails at not ok - media keeps the chosen paused player over one holding a stream.
  • bash test/shell.d/qmllint-test.sh passes.
  • Not checked in a running shell with real players.

Screenshots

No visible change: the media widget looks the same; only which player it selects when nothing is playing changes.

With nothing playing, the media service ranked any player holding a PipeWire stream above the player the user last chose. Chromium and Spotify keep a paused stream open, so clicking another paused player in the media popup, or pausing it with a media key, left the stream holder selected and the play key resumed it. The chosen player now comes first, and the choice lapses once another player starts playing, so a stale pick does not outrank a player used since.
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The PR keeps the chosen paused player selected even when another paused player holds an audio stream.

  • The media service keeps the chosen player when playback is idle.

Author crmne explicitly deferred stream-based selection without a preference, preference persistence across shell restarts, and preference retention when a player re-registers.

Reviews (1) · Last reviewed commit: "Keep the chosen media player when anothe..." · Reviewed by Greptile

@omarchybot omarchybot added the bug Something isn't working label Nov 29, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Codex High and Opus 5.5 High compared both diffs against current quattro and favored #9201. This PR fixes the paused-player picker in #17668. It can also resume the wrong player when a media key pauses Tauon, Chromium keeps playing, and you later pause Chromium in the browser. Tauon stays preferred because Chromium was already playing. #9201 remembers which player last played and also covers the case in #12772 where you pause from the app itself. The review was source-only, and the second opinion’s independence is not guaranteed.

I queued the focused stream-fallback and playerctld regression cases for #9201, which has a test-file conflict with current quattro. This PR stays open for the maintainer’s decision.

omarchybot added a commit to bldeden/omarchy that referenced this pull request Nov 29, 2026
Quattro removed the old media model test file in omacom#19904. Keep the regression coverage added by this PR and carry over omacom#20775’s checks for stream fallback and the playerctld proxy.

Co-Authored-By: Carmine Paolino <[email protected]>
Co-Authored-By: Codex GPT-6.2 Sol High <[email protected]>
@crmne

crmne commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #9201, which remembers the last player that played and also covers pausing from the app itself. Thanks for the comparison.

@crmne crmne closed this Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Media widget: selecting a paused player is ignored while another paused player holds an audio stream

2 participants