applets/taskmanager: only show media controls once
The media/volume controls in the tooltips are shown for each window in the group. This makes it look like they would be able to control each item separately, but they do not - each of them is simply a copy of the others and applies to the same instance of the media player (usually the one registered first) and the global application volume. This is wasteful, and rather confusing.
This change makes it so only the first item displays media and volume controls.
Screenshots:
before | after |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Of course it would be even better if each could be controlled individually. MPRIS does allow players to register multiple instances, but players don't always do this (in my testing, VLC did but Haruna did not) and even if they do, I'm not sure there's a way to map instances to windows (except guessing based on the window title). I'm not certain what the current state of volume controls is, but in the past audio streams were in practice not not assigned to window ids (see BUG 375943) and I don't think that has changed.
The first window was chosen because usually that is the first one started unless the user manually reordered them, so has a good chance of being the one actually controlled by MPRIS.
The current situation is not so bad if the list is horizontal (as in the third screenshot) when the space would just be empty anyways, but rather annoying on vertical lists, especially on Firefox when you have five windows open...).