diff --git a/libtaskmanager/xwindowtasksmodel.cpp b/libtaskmanager/xwindowtasksmodel.cpp --- a/libtaskmanager/xwindowtasksmodel.cpp +++ b/libtaskmanager/xwindowtasksmodel.cpp @@ -535,17 +535,25 @@ { const AppData &data = appData(window); + QUrl url = data.url; + if (!encodeFallbackIcon || !data.icon.name().isEmpty()) { - return data.url; + return url; } - QUrl url = data.url; - // Forego adding the window icon pixmap if the URL is otherwise empty. if (!url.isValid()) { return QUrl(); } + // If we have a proper service for an application, there's most likely an icon on disk + // that goes with it, no need to serialize it. + // QIcon::name() used above only works for icons created from an icon theme, not when + // created using from an absolute path, as can be the case with e.g. containerized apps. + if (url.scheme() == QLatin1String("applications")) { + return url; + } + const QPixmap pixmap = KWindowSystem::icon(window, KIconLoader::SizeLarge, KIconLoader::SizeLarge, false); if (pixmap.isNull()) { return data.url;