From 1931b5460034b63dcb1c89bd0c8825a751829f45 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 7 Dec 2025 22:33:45 +0900 Subject: hst: add pipewire flag These are for #26. None of them are implemented yet. This fixes up test cases for the change to happen. Existing source code and JSON configuration continue to have the same effect. Existing flags get its EPulse bit replaced by EPipeWire. Signed-off-by: Ophestra --- internal/outcome/outcome.go | 5 ++++- internal/store/data_test.go | 4 ++-- internal/store/header_test.go | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'internal') diff --git a/internal/outcome/outcome.go b/internal/outcome/outcome.go index e2563550..3252db9c 100644 --- a/internal/outcome/outcome.go +++ b/internal/outcome/outcome.go @@ -172,6 +172,8 @@ type outcomeStateSys struct { // Copied from [hst.Config]. Safe for read by spWaylandOp.toSystem only. directWayland bool + // Copied from [hst.Config]. Safe for read by spPulseOp.toSystem only. + directPulse bool // Copied header from [hst.Config]. Safe for read by spFilesystemOp.toSystem only. extraPerms []hst.ExtraPermConfig // Copied address from [hst.Config]. Safe for read by spDBusOp.toSystem only. @@ -185,7 +187,8 @@ type outcomeStateSys struct { func (s *outcomeState) newSys(config *hst.Config, sys *system.I) *outcomeStateSys { return &outcomeStateSys{ appId: config.ID, et: config.Enablements.Unwrap(), - directWayland: config.DirectWayland, extraPerms: config.ExtraPerms, + directWayland: config.DirectWayland, directPulse: config.DirectPulse, + extraPerms: config.ExtraPerms, sessionBus: config.SessionBus, systemBus: config.SystemBus, sys: sys, outcomeState: s, } diff --git a/internal/store/data_test.go b/internal/store/data_test.go index fe0e2124..a2eb92cd 100644 --- a/internal/store/data_test.go +++ b/internal/store/data_test.go @@ -47,9 +47,9 @@ func TestEntryData(t *testing.T) { {"inconsistent enablement", "\x00\xff\xca\xfe\x00\x00\xff\x00" + templateStateGob, NewTemplateState(), &hst.AppError{ Step: "validate state enablement", Err: os.ErrInvalid, - Msg: "state entry aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa has unexpected enablement byte 0xd, 0xff"}}, + Msg: "state entry aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa has unexpected enablement byte 0x1d, 0xff"}}, - {"template", "\x00\xff\xca\xfe\x00\x00\x0d\xf2" + templateStateGob, NewTemplateState(), nil}, + {"template", "\x00\xff\xca\xfe\x00\x00\x1d\xe2" + templateStateGob, NewTemplateState(), nil}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { diff --git a/internal/store/header_test.go b/internal/store/header_test.go index 51a6939a..9da547f8 100644 --- a/internal/store/header_test.go +++ b/internal/store/header_test.go @@ -34,7 +34,7 @@ func TestEntryHeader(t *testing.T) { {"success high", [entryHeaderSize]byte{0x00, 0xff, 0xca, 0xfe, 0x00, 0x00, 0xff, 0x00}, 0xff, nil}, {"success", [entryHeaderSize]byte{0x00, 0xff, 0xca, 0xfe, 0x00, 0x00, - 0x09, 0xf6}, hst.EWayland | hst.EPulse, nil}, + 0x09, 0xf6}, hst.EWayland | hst.EPipeWire, nil}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { -- cgit v1.3.1