Tray icon never appears when the StatusNotifierHost registers after UI startup (tray availability is only checked once)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia in service.py, in _setup_tray(), intorno alla riga 219, e analizza _show_gui_if_tray_not_available() intorno alla riga 258. Riproduci la race condition di avvio di Wayland con un host StatusNotifier che si registra in ritardo, quindi segui la configurazione esistente di QSystemTrayIcon e l’approccio suggerito con QDBusServiceWatcher. Il lavoro è completato quando l’icona nell’area di notifica appare dopo la registrazione dell’host senza riavviare opensnitch-ui, mentre il fallback di 10 secondi continua a comportarsi come previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
opensnitch-ui creates its QSystemTrayIcon exactly once during startup
(_setup_tray(), service.py L219 in v1.7.2). Qt decides at icon creation
time which backend to use: if the StatusNotifier host is not registered
yet (IsStatusNotifierHostRegistered on org.kde.StatusNotifierWatcher),
Qt silently falls back to XEmbed — which does not exist on Wayland — and
never switches back. Result: no tray icon for the whole session, even though
a fully working tray appears a moment later.
The existing 10 s fallback (_show_gui_if_tray_not_available(), L258) only
opens the stats window; it does not retry the tray registration.
This is easy to hit with bars/shells that claim the
org.kde.StatusNotifierWatcher name early in their startup but register
the host only after their UI has finished loading (e.g. Quickshell /
DankMaterialShell). XDG autostart then races the bar on every login: the
watcher name is already on the bus, but the host isn't there yet when
opensnitch-ui performs its one-shot check.
To Reproduce
- Wayland session (Hyprland) with a Quickshell-based bar (DankMaterialShell), opensnitch-ui in XDG autostart.
- Log in. opensnitch-ui starts ~1 s before the bar's tray host is registered.
busctl --user get-property org.kde.StatusNotifierWatcher /StatusNotifierWatcher org.kde.StatusNotifierWatcher RegisteredStatusNotifierItems→as 0although opensnitch-ui is running; no icon for the whole session.systemctl --user restartof the UI (after the bar is up) → icon appears immediately.
Expected behavior
The UI should (re-)register its tray icon when a StatusNotifier host becomes
available after startup — e.g. via a QDBusServiceWatcher on
org.kde.StatusNotifierWatcher plus re-checking IsStatusNotifierHostRegistered,
recreating the QSystemTrayIcon when the host appears. GTK apps and most
Electron apps handle this; any once-only check loses the race by design.
Workaround
systemd user drop-in for the autostart unit that delays the UI until the
host is registered:
[Service]
ExecStartPre=/bin/sh -c 'for i in $(seq 100); do busctl --user get-property org.kde.StatusNotifierWatcher /StatusNotifierWatcher org.kde.StatusNotifierWatcher IsStatusNotifierHostRegistered 2>/dev/null | grep -q true && exit 0; sleep 0.1; done'
Note: waiting for the watcher name alone is not sufficient (see above) —
the host property is the condition Qt actually checks.
Environment
- OpenSnitch 1.7.2 (daemon + UI), Arch Linux / CachyOS
- Qt 5.15.18, PyQt 5.15.11, running via XWayland (
xcbplatform; Wayland plugin not found) - Hyprland + DankMaterialShell 1.5.3 (Quickshell 0.3.1) as StatusNotifier watcher/host
Related: #940 (--background helps starting without a tray, but does not
make the icon appear once a tray shows up later).
- Lingua principale
- Python
- Stelle
- 14.3k
- Fork
- 689
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di evilsocket/opensnitch
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
evilsocket/opensnitch#1715 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
evilsocket/opensnitch#1689 · 3 commenti · 1 reazione ·
-
[Bug Report] list_subscriptions plugin prevents the UI from starting with protobuf < 3.20 (Fedora 44)Forse già presa @aadrian l’ha presa 48 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
evilsocket/opensnitch#1683 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
evilsocket/opensnitch#1675 ·
-
ui: Addresses tab shows raw column name "what"Forse già presa @aadrian l’ha presa 48 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
evilsocket/opensnitch#1674 · 2 commenti ·
Tutte le issue di evilsocket/opensnitch
Issue simili
-
[Bug]: DoubleMLData.from_arrays checks the treatment d with force_all_x_finite instead of force_all_d_finiteForse già presa @leninworld l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
DoubleML/doubleml-for-py#471 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
python-pillow/Pillow#10590 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
BUG: ZarrTrace fails in init_trace for models with datetime coordinates (object dtype coord array)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni