Blank system tray icon when using the Flatpak package
I'm using Waybar status bar on Wayland (Sway) which doesn't support XMBEDED so StatusNotifierItem is used.
I used D-Feet to check the IconName
property of the registered org.kde.StatusNotifierItem-*
interface and it shows that PhotoQT is is using a path within the sandbox for the icon name which isn't accessible for Waybar.
I worked around this issue by using QIcon::fromTheme
but maybe loading a pixmap will also work.
diff --git a/cplusplus/mainhandler.cpp b/cplusplus/mainhandler.cpp
index 3a79bdb8..32f85812 100644
--- a/cplusplus/mainhandler.cpp
+++ b/cplusplus/mainhandler.cpp
@@ -404,7 +404,7 @@ void MainHandler::handleTrayIcon(int val) {
delete trayIcon;
trayIcon = new QSystemTrayIcon(this);
- trayIcon->setIcon(QIcon(":/img/icon.png"));
+ trayIcon->setIcon(QIcon::fromTheme("org.photoqt.PhotoQt"));
trayIcon->setToolTip("PhotoQt " + tr("Image Viewer"));
// A context menu for the tray icon