Commit a97fe79d authored by Nicolas Fella's avatar Nicolas Fella Committed by Fushan Wen
Browse files

[libtaskmanager] Hide our new instance action when the app already has one

This is a heuristic based on some action names I've seen in the wild
parent b0563b1a
Pipeline #114978 passed with stage
in 8 minutes and 20 seconds
......@@ -787,6 +787,22 @@ bool canLauchNewInstance(const AppData &appData)
if (service->property(QStringLiteral("X-GNOME-SingleWindow"), QVariant::Bool).toBool()) {
return false;
}
// Hide our own action if there's already a "New Window" action
const auto actions = service->actions();
for (const KServiceAction &action : actions) {
if (action.name() == QLatin1String("NewWindow")) {
return false;
}
if (action.name() == QLatin1String("new-window")) {
return false;
}
if (action.name() == QLatin1String("WindowNew")) {
return false;
}
}
}
return true;
......
Supports Markdown
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