MCPcopy Index your code
hub / github.com/coder/coder / desktopGeometryForAction

Function desktopGeometryForAction

agent/x/agentdesktop/api.go:744–759  ·  view source on GitHub ↗
(cfg DisplayConfig, action DesktopAction)

Source from the content-addressed store, hash-verified

742}
743
744func desktopGeometryForAction(cfg DisplayConfig, action DesktopAction) workspacesdk.DesktopGeometry {
745 declaredWidth := cfg.Width
746 declaredHeight := cfg.Height
747 if action.ScaledWidth != nil && *action.ScaledWidth > 0 {
748 declaredWidth = *action.ScaledWidth
749 }
750 if action.ScaledHeight != nil && *action.ScaledHeight > 0 {
751 declaredHeight = *action.ScaledHeight
752 }
753 return workspacesdk.NewDesktopGeometryWithDeclared(
754 cfg.Width,
755 cfg.Height,
756 declaredWidth,
757 declaredHeight,
758 )
759}
760
761// missingFieldError is returned when a required field is absent from
762// a DesktopAction.

Callers 1

handleActionMethod · 0.85

Calls 1

Tested by

no test coverage detected