From c538df7daa21ce6c878b4ead7f0e06c4a0db8147 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 9 Dec 2025 06:51:12 +0900 Subject: [PATCH] internal/pipewire: expose connection props Unused in hakurei but could be useful when the package is moved out of internal. Signed-off-by: Ophestra --- internal/pipewire/pipewire.go | 7 ++++--- internal/system/dispatcher.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/pipewire/pipewire.go b/internal/pipewire/pipewire.go index 4659892..a87a4e9 100644 --- a/internal/pipewire/pipewire.go +++ b/internal/pipewire/pipewire.go @@ -820,8 +820,7 @@ func connectName(name string, manager bool) (conn *net.UnixConn, err error) { } // ConnectName connects to a PipeWire remote by name. -func ConnectName(name string, manager bool) (ctx *Context, err error) { - var props SPADict +func ConnectName(name string, manager bool, props SPADict) (ctx *Context, err error) { if manager { props = append(props, SPADictItem{Key: PW_KEY_REMOTE_INTENTION, Value: "manager"}) } @@ -847,4 +846,6 @@ func ConnectName(name string, manager bool) (ctx *Context, err error) { } // Connect connects to the PipeWire remote. -func Connect(manager bool) (ctx *Context, err error) { return ConnectName("", manager) } +func Connect(manager bool, props SPADict) (ctx *Context, err error) { + return ConnectName("", manager, props) +} diff --git a/internal/system/dispatcher.go b/internal/system/dispatcher.go index eae9247..8809159 100644 --- a/internal/system/dispatcher.go +++ b/internal/system/dispatcher.go @@ -89,7 +89,7 @@ func (k direct) waylandNew(displayPath, bindPath *check.Absolute, appID, instanc return wayland.New(displayPath, bindPath, appID, instanceID) } -func (k direct) pipewireConnect() (*pipewire.Context, error) { return pipewire.Connect(true) } +func (k direct) pipewireConnect() (*pipewire.Context, error) { return pipewire.Connect(true, nil) } func (k direct) xcbChangeHosts(mode xcb.HostMode, family xcb.Family, address string) error { return xcb.ChangeHosts(mode, family, address)