Commit d094bd37 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Task Manager] Honor "kde:pid" Metadata for when window PID isn't player PID

In plasma-browser-integration the browser window is a different PID from the host that owns the MPris
service leading to no media controls in task manager.

Differential Revision: https://phabricator.kde.org/D6359
parent b293137e
......@@ -235,10 +235,23 @@ Item {
if (source === "@multiplex") {
continue;
}
var sourceData = data[source];
if (sourceData && sourceData.DesktopEntry === desktopFileName && (pid === undefined || sourceData.InstancePid === pid)) {
if (!sourceData || sourceData.DesktopEntry !== desktopFileName) {
continue;
}
if (pid === undefined || sourceData.InstancePid === pid) {
return source;
}
var metadata = sourceData.Metadata;
if (metadata) {
var kdePid = metadata["kde:pid"];
if (kdePid && pid === kdePid) {
return source;
}
}
}
return ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment