Add Windows window-minimize guard

This commit is contained in:
2026-06-02 12:34:14 -04:00
parent d149736946
commit f37e295166
2 changed files with 22 additions and 1 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build !linux
//go:build !linux && !windows
package enforce
+21
View File
@@ -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()
}