Versions in this module Expand all Collapse all v0 v0.6.0 Jan 19, 2026 Changes in this version type Rect + func GetWorkAreaForRect(monitors []Monitor, rect Rect) Rect v0.5.0 Jan 18, 2026 v0.4.0 Jan 2, 2025 v0.4.0-beta.1 Dec 16, 2024 v0.3.0 Dec 16, 2024 v0.2.1 Dec 16, 2024 Changes in this version + func CalcPlacementSize(m *Monitor, desiredWidth, desiredHeight, minWidth, minHeight, margin int) (width, height int) + type DefaultMonitorMode int + const DefaultMonitorNearest + const DefaultMonitorNull + const DefaultMonitorPrimary type Monitor + func FindMonitorFromScreenPoint(monitors []Monitor, x, y int, defaultTo DefaultMonitorMode) *Monitor + func FindMonitorFromScreenRect(monitors []Monitor, rect Rect, defaultTo DefaultMonitorMode) *Monitor + func FindPrimaryMonitor(monitors []Monitor) *Monitor + type Point struct + X int + Y int + func LogicalToScreenPoint(m Monitor, x, y int) Point + func ScreenToLogicalPoint(m Monitor, x, y int) Point type Rect + func LogicalToScreenRect(m Monitor, logical Rect) Rect + func ScreenToLogicalRect(m Monitor, screen Rect) Rect v0.2.0 Dec 15, 2024 Changes in this version type Rect + func InitialPlacement(minWidth, minHeight, desiredWidth, desiredHeight, margin int) Rect v0.1.0 Dec 15, 2024 Changes in this version + var ErrInvalidDimensions = errors.New("invalid dimensions: negative width or height") + var ErrNoMonitors = errors.New("no monitors available") + func ContainsLogicalPoint(m Monitor, x, y int) bool + func ContainsPhysicalPoint(m Monitor, x, y int) bool + type FitMode int + const FitModeBounds + const FitModeWorkArea + type Monitor = types.Monitor + func FindMonitorFromLogicalPoint(monitors []Monitor, x, y int) *Monitor + func FindMonitorFromLogicalRect(monitors []Monitor, rect Rect) *Monitor + func FindMonitorFromPhysicalPoint(monitors []Monitor, x, y int) *Monitor + func GetMonitors() []Monitor + type Rect = types.Rect + func FitToMonitor(m Monitor, mode FitMode, window Rect) (Rect, error) + func FitToNearestMonitor(monitors []Monitor, mode FitMode, window Rect, minWidth, minHeight int) (Rect, error) + func LogicalToPhysical(m Monitor, logical Rect) Rect + func PhysicalToLogical(m Monitor, physical Rect) Rect