Fix invisible tray icon on Plasma 6 in Linux

PR #20529.
Closes #20367.

---------

Co-authored-by: thalieht <thalieht@users.noreply.github.com>
Co-authored-by: Vladimir Golovnev <glassez@yandex.ru>
This commit is contained in:
tehcneko 2024-03-13 15:24:08 +08:00 committed by Vladimir Golovnev (Glassez)
parent d5a3f724ab
commit 64acc64c58
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7

View file

@ -31,6 +31,7 @@
#include <chrono> #include <chrono>
#include <QtGlobal>
#include <QMenu> #include <QMenu>
#include <QTimer> #include <QTimer>
@ -300,11 +301,11 @@ QIcon DesktopIntegration::getSystrayIcon() const
icon = UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_s); icon = UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_s);
break; 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 // Workaround for invisible tray icon in KDE, https://bugreports.qt.io/browse/QTBUG-53550
return {icon.pixmap(32)}; if (qEnvironmentVariable("XDG_CURRENT_DESKTOP").compare(u"KDE", Qt::CaseInsensitive) == 0)
#else return icon.pixmap(32);
return icon;
#endif #endif
return icon;
} }
#endif // Q_OS_MACOS #endif // Q_OS_MACOS