( s protocols.ClientState, object_id protocols.ObjectID[protocols.WlSubsurface], sibling_or_parent_id protocols.ObjectID[protocols.WlSurface], aboveOrBelow ZOrder, )
| 94 | } |
| 95 | |
| 96 | func (ss *WlSubsurface) PlaceSubsurface( |
| 97 | s protocols.ClientState, |
| 98 | object_id protocols.ObjectID[protocols.WlSubsurface], |
| 99 | sibling_or_parent_id protocols.ObjectID[protocols.WlSurface], |
| 100 | aboveOrBelow ZOrder, |
| 101 | ) { |
| 102 | surfaceID := GetSurfaceIDFromRole(s, object_id) |
| 103 | if surfaceID == nil { |
| 104 | SendError(s, object_id, protocols.WlSubsurfaceError_enum_bad_surface, "surface not found") |
| 105 | return |
| 106 | } |
| 107 | |
| 108 | parent := GetWlSurfaceObject(s, ss.Parent) |
| 109 | |
| 110 | if parent == nil { |
| 111 | SendError(s, object_id, protocols.WlSubsurfaceError_enum_bad_surface, "parent not found") |
| 112 | return |
| 113 | } |
| 114 | |
| 115 | var id *protocols.ObjectID[protocols.WlSurface] |
| 116 | if sibling_or_parent_id == ss.Parent { |
| 117 | id = nil |
| 118 | } else { |
| 119 | id = &sibling_or_parent_id |
| 120 | } |
| 121 | |
| 122 | if (*parent).PendingUpdate.ZOrderSubsurfaces == nil { |
| 123 | (*parent).PendingUpdate.ZOrderSubsurfaces = []ZOrderSubsurface{} |
| 124 | } |
| 125 | (*parent).PendingUpdate.ZOrderSubsurfaces = append( |
| 126 | (*parent).PendingUpdate.ZOrderSubsurfaces, |
| 127 | ZOrderSubsurface{ |
| 128 | Type: aboveOrBelow, |
| 129 | ChildToMove: *surfaceID, |
| 130 | RelativeTo: id, |
| 131 | }, |
| 132 | ) |
| 133 | } |
| 134 | func (ss *WlSubsurface) WlSubsurface_place_below( |
| 135 | s protocols.ClientState, |
| 136 | object_id protocols.ObjectID[protocols.WlSubsurface], |
no test coverage detected