diff --git a/internal/enforce/guard_other.go b/internal/enforce/guard_other.go index d009114..7405110 100644 --- a/internal/enforce/guard_other.go +++ b/internal/enforce/guard_other.go @@ -1,4 +1,4 @@ -//go:build !linux +//go:build !linux && !windows package enforce diff --git a/internal/enforce/windows.go b/internal/enforce/windows.go new file mode 100644 index 0000000..5dc4444 --- /dev/null +++ b/internal/enforce/windows.go @@ -0,0 +1,21 @@ +//go:build windows + +package enforce + +import ( + "context" + + "antidrift/internal/winapi" +) + +// NewGuard returns the Windows window-minimize guard. +func NewGuard() Guard { return windowsGuard{} } + +type windowsGuard struct{} + +// MinimizeActive minimizes the current foreground window. It is best-effort: +// with nothing focused it does nothing and returns nil. Stateless and per-call, +// mirroring the short-lived X11 connection model. +func (windowsGuard) MinimizeActive(context.Context) error { + return winapi.MinimizeForeground() +}