aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/spx11.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-10 02:23:34 +0900
committerOphestra <cat@gensokyo.uk>2025-10-10 02:23:34 +0900
commit22ee5ae151fa991cf23dbf1b3efb5a0d6fb9b092 (patch)
treef0bac6b7a1d52af021f9e48c9d04cb371f291a0e /internal/app/spx11.go
parent4246256d781f169b86f76d8654f6df5ffc6ddae6 (diff)
internal/app: filter ops in implementation
This is cleaner and less error-prone, and should also result in negligibly less memory allocation. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/spx11.go')
-rw-r--r--internal/app/spx11.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/app/spx11.go b/internal/app/spx11.go
index e0e10672..219f2cb2 100644
--- a/internal/app/spx11.go
+++ b/internal/app/spx11.go
@@ -25,6 +25,10 @@ type spX11Op struct {
}
func (s *spX11Op) toSystem(state *outcomeStateSys) error {
+ if state.config.Enablements.Unwrap()&hst.EX11 == 0 {
+ return errNotEnabled
+ }
+
if d, ok := state.k.lookupEnv("DISPLAY"); !ok {
return newWithMessage("DISPLAY is not set")
} else {