Bug 506209

Summary: plasma-browser-integration takes priority in MPRIS when focusing browser window
Product: [Plasma] plasma-browser-integration Reporter: s+kdeb
Component: FirefoxAssignee: Kai Uwe Broulik <kde>
Status: REPORTED ---    
Severity: normal Keywords: usability
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description s+kdeb 2025-06-26 11:44:35 UTC
SUMMARY
`plasma-browser-integration` takes priority in MPRIS when focusing browser window. Other players behave such that only when an action is performed on a player (such as play/pause) then it takes priority. 
The integration takes priority even without an action, which is a big issue in terms of usability when having a browser and a media player open, because the browser keeps getting focus on random players even though it's the music that is playing that should keep it. I personally notice Reddit video players or previews on Youtube thumbnails taking the focus.


STEPS TO REPRODUCE
1. Open any player in Firefox (with `plasma-browser-integration` installed)
2. Open a separate player in a different process or browser
3. Perform actions on the separate player
4. Click on the Firefox window
5. Run `playerctl -l`

OBSERVED RESULT
```
plasma-browser-integration
chromium.instance383454
firefox.instance_1_54
```
`plasma-browser-integration` jumps to the first spot even though the player was not accessed

EXPECTED RESULT
```
chromium.instance383454
plasma-browser-integration
firefox.instance_1_54
```
`chromium.instance383454` should still be the first one since this one was last accessed

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1
Kernel Version: 6.15.3-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 9950X3D 16-Core Processor
Memory: 64 GiB of RAM (60.4 GiB usable)
Graphics Processor 1: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2
Graphics Processor 2: NVIDIA GeForce RTX 4070 Ti SUPER/PCIe/SSE2

ADDITIONAL INFORMATION
Removing `plasma-browser-integration` makes the media player a lot more usable since Firefox exposes its own controls and doesn't have the same issue, but it's not a solution.