Tray icon not showing on Wayland (Hyprland) even with root privileges
Environment
OS: CachyOS (Arch-based)
Desktop: Hyprland (Wayland compositor)
FPTN version: 0.3.39
Installation: converted from .deb via debtap
Problem
The tray icon never appears when running FPTN on Wayland with Hyprland. The process starts successfully but the icon is never registered in the system tray.
Steps to reproduce
Install FPTN on any Wayland-based desktop (tested on Hyprland)
Run sudo /opt/fptn/fptn-client-gui
No tray icon appears
Console output
Application started successfully.
QSystemTrayIcon::setVisible: No Icon set
failed to register "org.kde.StatusNotifierItem-XXXX-1" "/StatusNotifierItem"
Root cause investigation
The application requires root (getuid() == 0 check), but running Qt6 GUI applications as root under Wayland is blocked by design — Wayland security model does not allow root processes to connect to a user compositor session.
When bypassing the root check via LD_PRELOAD (faking getuid/geteuid to return 0) and running as regular user, the process starts but still outputs QSystemTrayIcon::setVisible: No Icon set before attempting DBus registration — meaning Qt does not set the icon at all, and the StatusNotifierItem registration fails as a result.
Tested workarounds that did NOT help:
sudo with preserved env vars (WAYLAND_DISPLAY, XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESS)
setcap cap_net_admin,cap_net_raw+eip (app still requires getuid==0)
LD_PRELOAD fake root + correct DBus session address
snixembed, xembed-sni-proxy
QT_QPA_PLATFORM=wayland, QT_QPA_PLATFORMTHEME=gtk3
dbus-run-session
Expected behavior
Tray icon should appear and be functional on Wayland compositors that support org.kde.StatusNotifierItem protocol (which Hyprland does — Telegram and other apps show tray icons fine).
Possible fix
Remove or rework the hard getuid() == 0 requirement — use Linux capabilities (cap_net_admin, cap_net_raw) instead of requiring full root
Separate the privileged VPN tunnel management (which needs root) from the GUI process (which should run as regular user) via a privileged helper/daemon
This would allow the Qt GUI to run as a regular user and properly connect to the Wayland session and DBus
Tray icon not showing on Wayland (Hyprland) even with root privileges
Environment
OS: CachyOS (Arch-based)
Desktop: Hyprland (Wayland compositor)
FPTN version: 0.3.39
Installation: converted from .deb via debtap
Problem
The tray icon never appears when running FPTN on Wayland with Hyprland. The process starts successfully but the icon is never registered in the system tray.
Steps to reproduce
Install FPTN on any Wayland-based desktop (tested on Hyprland)
Run sudo /opt/fptn/fptn-client-gui
No tray icon appears
Console output
Application started successfully.
QSystemTrayIcon::setVisible: No Icon set
failed to register "org.kde.StatusNotifierItem-XXXX-1" "/StatusNotifierItem"
Root cause investigation
The application requires root (getuid() == 0 check), but running Qt6 GUI applications as root under Wayland is blocked by design — Wayland security model does not allow root processes to connect to a user compositor session.
When bypassing the root check via LD_PRELOAD (faking getuid/geteuid to return 0) and running as regular user, the process starts but still outputs QSystemTrayIcon::setVisible: No Icon set before attempting DBus registration — meaning Qt does not set the icon at all, and the StatusNotifierItem registration fails as a result.
Tested workarounds that did NOT help:
sudo with preserved env vars (WAYLAND_DISPLAY, XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESS)
setcap cap_net_admin,cap_net_raw+eip (app still requires getuid==0)
LD_PRELOAD fake root + correct DBus session address
snixembed, xembed-sni-proxy
QT_QPA_PLATFORM=wayland, QT_QPA_PLATFORMTHEME=gtk3
dbus-run-session
Expected behavior
Tray icon should appear and be functional on Wayland compositors that support org.kde.StatusNotifierItem protocol (which Hyprland does — Telegram and other apps show tray icons fine).
Possible fix
Remove or rework the hard getuid() == 0 requirement — use Linux capabilities (cap_net_admin, cap_net_raw) instead of requiring full root
Separate the privileged VPN tunnel management (which needs root) from the GUI process (which should run as regular user) via a privileged helper/daemon
This would allow the Qt GUI to run as a regular user and properly connect to the Wayland session and DBus