diff --git a/libtaskmanager/taskmanagerrulesrc b/libtaskmanager/taskmanagerrulesrc --- a/libtaskmanager/taskmanagerrulesrc +++ b/libtaskmanager/taskmanagerrulesrc @@ -17,7 +17,7 @@ MatchCommandLineFirst=VirtualBox [Rewrite Rules][google-chrome][1] -Property=ClassName +Property=ClassNameFixed a bug when switching wallpapers Identifier=DesktopEntryName Match=(?<=crx_)(?'match'[a-z]+) Target=chrome-%1-default diff --git a/libtaskmanager/xwindowtasksmodel.cpp b/libtaskmanager/xwindowtasksmodel.cpp --- a/libtaskmanager/xwindowtasksmodel.cpp +++ b/libtaskmanager/xwindowtasksmodel.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -515,12 +516,14 @@ if (!classClass.isEmpty() && matchCommandLineFirst.contains(classClass)) { triedPid = true; services = servicesFromPid(pid); + qDebug() << "a" << services; } // Try to match using className also. - if (!className.isEmpty() && matchCommandLineFirst.contains("::"+className)) { + if (services.empty() && !className.isEmpty() && matchCommandLineFirst.contains("::"+className)) { triedPid = true; services = servicesFromPid(pid); + qDebug() << "b" << services; } // If the user has manually set a mapping, respect this first... @@ -606,6 +609,7 @@ // To match other docks (docky, unity, etc.) attempt to match on DesktopEntryName first ... if (services.empty()) { services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ DesktopEntryName)").arg(classClass)); + qDebug() << classClass << services; } // Try StartupWMClass. @@ -619,6 +623,8 @@ } } + qDebug() << "c" << services; + // Ok, absolute *last* chance, try matching via pid (but only if we have not already tried this!) ... if (services.empty() && !triedPid) { services = servicesFromPid(pid); @@ -768,6 +774,8 @@ KSysGuard::Process *proc = procs.getProcess(pid); QString cmdline = proc ? proc->command().simplified() : QString(); // proc->command has a trailing space??? + qDebug() << cmdline; + if (cmdline.isEmpty()) { return services; } @@ -779,7 +787,9 @@ // Could not find with complete commandline, so strip out path part... int slash = cmdline.lastIndexOf('/', firstSpace); if (slash > 0) { - services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Exec)").arg(cmdline.mid(slash + 1))); + qDebug() << cmdline.mid(slash + 1); + services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('VirtualBox' =~ Exec)")); + qDebug() << services; } } @@ -790,7 +800,7 @@ int slash = cmdline.lastIndexOf('/'); if (slash > 0) { - services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Exec)").arg(cmdline.mid(slash + 1))); + services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), QStringLiteral("exist Exec and ('%1' =~ Exec)").arg(cmdline.mid(slash + 1) + " %u")); } } diff --git a/plasma-windowed/main.cpp b/plasma-windowed/main.cpp --- a/plasma-windowed/main.cpp +++ b/plasma-windowed/main.cpp @@ -19,6 +19,9 @@ * along with this program. If not, see */ +#define QT_QML_DEBUG +#include + #include #include #include