diff --git a/main.go b/main.go index 292954f..e00dbf2 100644 --- a/main.go +++ b/main.go @@ -73,7 +73,7 @@ func (e *chatEmitter) append(text string) { e.buf += text if !e.running { e.running = true - e.timer = time.AfterFunc(50*time.Millisecond, e.flush) + e.timer = time.AfterFunc(150*time.Millisecond, e.flush) } e.mu.Unlock() } @@ -707,17 +707,19 @@ func (m *SessionManager) DismissDetached(sessionID string, pid int32) (bool, *db // --- Notifications --- func (m *SessionManager) sendNotification(title, body string) { - obj := m.conn.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications") - obj.Call("org.freedesktop.Notifications.Notify", 0, - "ollie-dbus", // app_name - uint32(0), // replaces_id - "system-run", // app_icon - title, // summary - body, // body - []string{}, // actions - map[string]dbus.Variant{}, // hints - int32(5000), // timeout ms - ) + go func() { + obj := m.conn.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications") + obj.Call("org.freedesktop.Notifications.Notify", 0, + "ollie-dbus", // app_name + uint32(0), // replaces_id + "system-run", // app_icon + title, // summary + body, // body + []string{}, // actions + map[string]dbus.Variant{}, // hints + int32(5000), // timeout ms + ) + }() } // --- Session Persistence ---