From e2795d4bf301bcfc0ea90adaa4df2b747decf5b2 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Mon, 22 Mar 2021 18:47:28 +0000 Subject: [PATCH] Don't allow (darwin) DBus to hang our app --- wm/notifications.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wm/notifications.go b/wm/notifications.go index 28e0cafa..3459a953 100644 --- a/wm/notifications.go +++ b/wm/notifications.go @@ -63,12 +63,16 @@ func (n *notifications) GetCapabilities() []string { return []string{"body", "icon-static", "persistence"} } -func startNotifications() *notifications { - n := ¬ifications{} +func (n *notifications) register() { err := RegisterService(n, "/org/freedesktop/Notifications", "org.freedesktop.Notifications") if err != nil { fyne.LogError("Could not start DBus notifications server, using local only", err) } +} + +func startNotifications() *notifications { + n := ¬ifications{} + go n.register() return n }