From 64acc64c580d2a03e991e5160e91823dafdc6a09 Mon Sep 17 00:00:00 2001 From: tehcneko Date: Wed, 13 Mar 2024 15:24:08 +0800 Subject: [PATCH] Fix invisible tray icon on Plasma 6 in Linux PR #20529. Closes #20367. --------- Co-authored-by: thalieht Co-authored-by: Vladimir Golovnev --- src/gui/desktopintegration.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/desktopintegration.cpp b/src/gui/desktopintegration.cpp index f8a4c85cb..466d62c8c 100644 --- a/src/gui/desktopintegration.cpp +++ b/src/gui/desktopintegration.cpp @@ -31,6 +31,7 @@ #include +#include #include #include @@ -300,11 +301,11 @@ QIcon DesktopIntegration::getSystrayIcon() const icon = UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_s); break; } -#if ((QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) +#ifdef Q_OS_UNIX // Workaround for invisible tray icon in KDE, https://bugreports.qt.io/browse/QTBUG-53550 - return {icon.pixmap(32)}; -#else - return icon; + if (qEnvironmentVariable("XDG_CURRENT_DESKTOP").compare(u"KDE", Qt::CaseInsensitive) == 0) + return icon.pixmap(32); #endif + return icon; } #endif // Q_OS_MACOS