diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-10 03:19:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-10 03:19:09 +0900 |
| commit | 109aaee6593ac6e72d23b817e5b75292c2ed7bed (patch) | |
| tree | 459fbd8f8c0685b33002fb1f9c101c9b39a38b6a /internal/app/spwayland.go | |
| parent | 22ee5ae151fa991cf23dbf1b3efb5a0d6fb9b092 (diff) | |
internal/app: copy parts of config to state
This is less error-prone than passing the address to the entire hst.Config struct, and reduces the likelihood of accidentally clobbering hst.Config. This also improves ease of testing.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/spwayland.go')
| -rw-r--r-- | internal/app/spwayland.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/app/spwayland.go b/internal/app/spwayland.go index 25fc118b..5355c32a 100644 --- a/internal/app/spwayland.go +++ b/internal/app/spwayland.go @@ -18,7 +18,7 @@ type spWaylandOp struct { } func (s *spWaylandOp) toSystem(state *outcomeStateSys) error { - if state.config.Enablements.Unwrap()&hst.EWayland == 0 { + if state.et&hst.EWayland == 0 { return errNotEnabled } @@ -33,14 +33,14 @@ func (s *spWaylandOp) toSystem(state *outcomeStateSys) error { socketPath = a } - if !state.config.DirectWayland { // set up security-context-v1 - appID := state.config.ID - if appID == "" { + if !state.directWayland { // set up security-context-v1 + appId := state.appId + if appId == "" { // use instance ID in case app id is not set - appID = "app.hakurei." + state.id.String() + appId = "app.hakurei." + state.id.String() } // downstream socket paths - state.sys.Wayland(state.instance().Append("wayland"), socketPath, appID, state.id.String()) + state.sys.Wayland(state.instance().Append("wayland"), socketPath, appId, state.id.String()) } else { // bind mount wayland socket (insecure) state.msg.Verbose("direct wayland access, PROCEED WITH CAUTION") state.ensureRuntimeDir() |
