MCPcopy
hub / github.com/mmulet/term.everything / WlSubsurface_set_position

Method WlSubsurface_set_position

wayland/wl_subsurface.go:57–86  ·  view source on GitHub ↗
(
	s protocols.ClientState,
	object_id protocols.ObjectID[protocols.WlSubsurface],
	x int32,
	y int32,
)

Source from the content-addressed store, hash-verified

55}
56
57func (ss *WlSubsurface) WlSubsurface_set_position(
58 s protocols.ClientState,
59 object_id protocols.ObjectID[protocols.WlSubsurface],
60 x int32,
61 y int32,
62) {
63 surfaceID := GetSurfaceIDFromRole(s, object_id)
64 if surfaceID == nil {
65 SendError(s, object_id, protocols.WlSubsurfaceError_enum_bad_surface, "surface not found")
66 return
67 }
68
69 parent := GetWlSurfaceObject(s, ss.Parent)
70 if parent == nil {
71 SendError(s, object_id, protocols.WlSubsurfaceError_enum_bad_surface, "parent not found")
72 return
73 }
74 if (*parent).PendingUpdate.SetChildPosition == nil {
75 (*parent).PendingUpdate.SetChildPosition = []ChildPosition{}
76 }
77
78 (*parent).PendingUpdate.SetChildPosition = append(
79 (*parent).PendingUpdate.SetChildPosition,
80 ChildPosition{
81 Child: *surfaceID,
82 X: x,
83 Y: y,
84 },
85 )
86}
87
88func (ss *WlSubsurface) WlSubsurface_place_above(
89 s protocols.ClientState,

Callers

nothing calls this directly

Calls 2

GetSurfaceIDFromRoleFunction · 0.85
SendErrorFunction · 0.85

Tested by

no test coverage detected