Commit 513ad12b authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

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
parent 2a3b74df
......@@ -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));
......
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