mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-07 10:45:59 -10:00
fix(desktop): harden topic ids and tray probing
This commit is contained in:
1 parent
c8ccc01740
commit
c675d754cc
2 files changed
+6
-2
No files matched your search
+4
-1
@@ -5156,7 +5156,10 @@ func newTabID() string {
|
||||
|
||||
func newTopicID() string {
|
||||
var b [8]byte
|
||||
rand.Read(b[:])
|
||||
if _, err := rand.Read(b[:]); err != nil {
|
||||
now := time.Now().UTC()
|
||||
return "topic_" + now.Format("20060102-150405") + "_" + fmt.Sprintf("%09d", now.Nanosecond())
|
||||
}
|
||||
return "topic_" + time.Now().UTC().Format("20060102-150405") + "_" + hex.EncodeToString(b[:])
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ func traySupported() bool {
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
defer conn.Close()
|
||||
// SessionBus returns a shared singleton connection. Do not close it here:
|
||||
// other desktop integrations in this process may still be using it.
|
||||
obj := conn.Object("org.freedesktop.DBus", "/org/freedesktop/DBus")
|
||||
var owner string
|
||||
return obj.Call("org.freedesktop.DBus.GetNameOwner", 0, "org.kde.StatusNotifierWatcher").Store(&owner) == nil && owner != ""
|
||||
|
||||
Reference in new issue
Block a user