| Summary: | mute icon on task bar appears on wrong applications | ||
|---|---|---|---|
| Product: | [Plasma] plasmashell | Reporter: | Alexis Murzeau <amubtdx> |
| Component: | Task Manager and Icons-Only Task Manager widgets | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | nate, qydwhotmail |
| Priority: | NOR | ||
| Version First Reported In: | 5.26.90 | ||
| Target Milestone: | 1.0 | ||
| Platform: | Debian unstable | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/-/commit/c27fb3c0d25a0ad7af44acd1d9e957cdaae8802e | Version Fixed/Implemented In: | 5.27 |
| Sentry Crash Report: | |||
| Attachments: |
plasma-desktop-5.26.5_no_duplicate_icons.png
plasma-desktop-5.26.90_duplicate_icons.png |
||
|
Description
Alexis Murzeau
2023-02-06 22:13:40 UTC
Created attachment 156011 [details]
plasma-desktop-5.26.5_no_duplicate_icons.png
Created attachment 156012 [details]
plasma-desktop-5.26.90_duplicate_icons.png
I've added 2 screenshots. The difference between the two are:
- Opened some applications including Spotify, foobar2000 and gitk
- Spotify is the only application playing music
- Upgraded plasma-desktop from 5.26.5 to 5.26.90
- Run `plasmashell --replace` in a terminal
The first icon is a non-running, pinned, application.
When clicking on one of the mute buttons, Spotify is muted and all mute buttons become "unmute" buttons (their icon changed).
I'm using pulseaudio and jackd only (no pipewire).
I found that the issue is related to this line of code: https://invent.kde.org/plasma/plasma-desktop/-/blob/1988f0756ec9b61d6eff6eae14c1023502d7f701/applets/taskmanager/package/contents/ui/Task.qml#L233 var streams = pa.streamsForAppId(task.appId); Some applications like the first pinned application icon, foobar2000 and gitk in the screenshots don't have a task.appId (using console.log() I found that the string was empty). I guess that when appId is an empty string, pa.streamsForAppId will return all streams, that would explain why it shows a mute icon on them. Adding a if(task.appId) around that line of code fixes the issue: --- /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml.bak 2023-01-19 12:40:03.000000000 +0100 +++ /usr/share/plasma/plasmoids/org.kde.plasma.taskmanager/contents/ui/Task.qml 2023-02-06 23:41:02.020817778 +0100 @@ -230,7 +230,10 @@ // Check appid first for app using portal // https://docs.pipewire.org/page_portal.html - var streams = pa.streamsForAppId(task.appId); + var streams = []; + if(task.appId) { + pa.streamsForAppId(task.appId); + } if (!streams.length) { streams = pa.streamsForPid(task.pid); if (streams.length) { appId shouldn't be empty. If it's empty there is a bug in libtaskmanager. I've tried the linked commit (c27fb3c0d25a0ad7af44acd1d9e957cdaae8802e) on plasma-workspace and confirm that this fixes the issue. Thanks :) |