22 lines
530 B
Go
22 lines
530 B
Go
//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()
|
|
}
|