Add Windows window-minimize guard
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//go:build !linux
|
||||
//go:build !linux && !windows
|
||||
|
||||
package enforce
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user