Map StartupWMClass for Chrome apps instead of RegExp'ing the name

We only matched for the "Default" suffix which is the default profile but this breaks
when having apps installed in different profiles where they get e.g. "Profile_1" suffix.

BUG: 376695
FIXED-IN: 5.9.3

Differential Revision: https://phabricator.kde.org/D4680
wilder-5.14
Kai Uwe Broulik 9 years ago
parent 2a3b74df75
commit 513ad12b76
  1. 15
      libtaskmanager/taskmanagerrulesrc
  2. 6
      libtaskmanager/xwindowtasksmodel.cpp

@ -17,32 +17,27 @@ ManualOnly=Wine
[Rewrite Rules][google-chrome][1]
Property=ClassName
Identifier=DesktopEntryName
Identifier=StartupWMClass
Match=(?<=crx_)(?'match'[a-z]+)
Target=chrome-%1-default
# Google changed the class to be "Google-chrome" around version 54
[Rewrite Rules][Google-chrome][1]
Property=ClassName
Identifier=DesktopEntryName
Identifier=StartupWMClass
Match=(?<=crx_)(?'match'[a-z]+)
Target=chrome-%1-default
[Rewrite Rules][chromium][1]
Property=ClassName
Identifier=DesktopEntryName
Identifier=StartupWMClass
Match=(?<=crx_)(?'match'[a-z]+)
Target=chrome-%1-default
[Rewrite Rules][chromium-browser][1]
Property=ClassName
Identifier=DesktopEntryName
Identifier=StartupWMClass
Match=(?<=crx_)(?'match'[a-z]+)
Target=chrome-%1-default
# Chromium changed the class too
[Rewrite Rules][Chromium][1]
Property=ClassName
Identifier=DesktopEntryName
Identifier=StartupWMClass
Match=(?<=crx_)(?'match'[a-z]+)
Target=chrome-%1-default

@ -592,7 +592,11 @@ QUrl XWindowTasksModel::Private::windowUrl(WId window)
continue;
}
const QString rewrittenString = ruleGroup.readEntry(QStringLiteral("Target")).arg(actualMatch);
QString rewrittenString = ruleGroup.readEntry(QStringLiteral("Target")).arg(actualMatch);
// If no "Target" is provided, instead assume the matched property (ClassClass/ClassName).
if (rewrittenString.isEmpty()) {
rewrittenString = matchProperty;
}
services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ %2)").arg(rewrittenString, serviceSearchIdentifier));

Loading…
Cancel
Save