Skip to content

Commit 64acc64

Browse files
tehcnekothaliehtglassez
committed
Fix invisible tray icon on Plasma 6 in Linux
PR qbittorrent#20529. Closes qbittorrent#20367. --------- Co-authored-by: thalieht <[email protected]> Co-authored-by: Vladimir Golovnev <[email protected]>
1 parent d5a3f72 commit 64acc64

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/gui/desktopintegration.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include <chrono>
3333

34+
#include <QtGlobal>
3435
#include <QMenu>
3536
#include <QTimer>
3637

@@ -300,11 +301,11 @@ QIcon DesktopIntegration::getSystrayIcon() const
300301
icon = UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_s);
301302
break;
302303
}
303-
#if ((QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && defined(Q_OS_UNIX) && !defined(Q_OS_MACOS))
304+
#ifdef Q_OS_UNIX
304305
// Workaround for invisible tray icon in KDE, https://bugreports.qt.io/browse/QTBUG-53550
305-
return {icon.pixmap(32)};
306-
#else
307-
return icon;
306+
if (qEnvironmentVariable("XDG_CURRENT_DESKTOP").compare(u"KDE", Qt::CaseInsensitive) == 0)
307+
return icon.pixmap(32);
308308
#endif
309+
return icon;
309310
}
310311
#endif // Q_OS_MACOS

0 commit comments

Comments
 (0)