mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kio: disable ASN for services without entry path
it should not be assumed that applications support ASN to begin with but currently is Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
53fda3a2f6
commit
4c7a71e55a
1 changed files with 17 additions and 24 deletions
|
@ -583,36 +583,29 @@ static bool runCommandInternal(KProcess* proc, const KService* service, const QS
|
||||||
// This code is also used in klauncher.
|
// This code is also used in klauncher.
|
||||||
bool KRun::checkStartupNotify(const KService* service, bool* silent_arg, QByteArray* wmclass_arg)
|
bool KRun::checkStartupNotify(const KService* service, bool* silent_arg, QByteArray* wmclass_arg)
|
||||||
{
|
{
|
||||||
|
if (!service || service->entryPath().isEmpty()) {
|
||||||
|
// non-compliant app or service action
|
||||||
|
|
||||||
|
// TODO: for service actions (and other KService's crafted from the name, exec and icon)
|
||||||
|
// get the ASN property from the "Desktop Entry" group in the .desktop file somehow
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool silent = false;
|
bool silent = false;
|
||||||
QByteArray wmclass;
|
QByteArray wmclass;
|
||||||
if (service && service->property("StartupNotify").isValid()) {
|
if (service->property("StartupNotify").isValid()) {
|
||||||
silent = !service->property("StartupNotify").toBool();
|
silent = !service->property("StartupNotify").toBool();
|
||||||
wmclass = service->property("StartupWMClass").toString().toLatin1();
|
wmclass = service->property("StartupWMClass").toString().toLatin1();
|
||||||
}
|
} else if (service->property("X-KDE-StartupNotify").isValid()) {
|
||||||
else if (service && service->property("X-KDE-StartupNotify").isValid()) {
|
|
||||||
silent = !service->property("X-KDE-StartupNotify").toBool();
|
silent = !service->property("X-KDE-StartupNotify").toBool();
|
||||||
wmclass = service->property("X-KDE-WMClass").toString().toLatin1();
|
wmclass = service->property("X-KDE-WMClass").toString().toLatin1();
|
||||||
}
|
} else {
|
||||||
else { // non-compliant app
|
// non-compliant app
|
||||||
if (service) {
|
if (service->isApplication()) {
|
||||||
if (service->isApplication()) { // doesn't have .desktop entries needed, start as non-compliant
|
// doesn't have .desktop entries needed, start as non-compliant
|
||||||
wmclass = "0"; // krazy:exclude=doublequote_chars
|
wmclass = "0";
|
||||||
}
|
} else {
|
||||||
else {
|
return false; // no startup notification at all
|
||||||
return false; // no startup notification at all
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#if 0
|
|
||||||
// Create startup notification even for apps for which there shouldn't be any,
|
|
||||||
// just without any visual feedback. This will ensure they'll be positioned on the proper
|
|
||||||
// virtual desktop, and will get user timestamp from the ASN ID.
|
|
||||||
wmclass = '0';
|
|
||||||
silent = true;
|
|
||||||
#else // That unfortunately doesn't work, when the launched non-compliant application
|
|
||||||
// launches another one that is compliant and there is any delay inbetween (bnc:#343359)
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (silent_arg != NULL) {
|
if (silent_arg != NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue