1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-10 07:42:09 -04:00

fix: add TrayRecoveryService with bidirectional SNI dedup

Add TrayRecoveryService singleton that re-registers lost tray icons
after resume from suspend via a bash DBus scan.

The service resolves every registered SNI item (both well-known names
and :1.xxx connection IDs) to a canonical connection ID, building a
unified REGISTERED_CONN_IDS set before either scan section runs. This
prevents duplicates in both directions:

- If an app registered via well-known name, the connection-ID section
  skips its :1.xxx entry.
- If an app registered via connection ID, the well-known-name section
  skips its well-known name (checked through REGISTERED_CONN_IDS).
- After successfully registering via well-known name, REGISTERED_CONN_IDS
  is updated immediately so the connection-ID section won't probe the
  same app in the same run.

A single busctl snapshot (BUSCTL_OUT) is reused across both sections,
replacing redundant dbus-send ListNames calls. The SNI Id dedup check
inside the connection-ID subshells is now case-insensitive (-i flag)
as a secondary fallback.
This commit is contained in:
Dimariqe
2026-03-31 15:18:52 +07:00
parent e9aeb9ac60
commit 1470aa3185
2 changed files with 148 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ import qs.Services
Item {
id: root
readonly property var _trayRecovery: TrayRecoveryService
Instantiator {
id: daemonPluginInstantiator
asynchronous: true