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

Method XdgWmBase_get_xdg_surface

wayland/xdg_wm_base.go:28–66  ·  view source on GitHub ↗
(
	s protocols.ClientState,
	objectID protocols.ObjectID[protocols.XdgWmBase],
	xdgSurfaceID protocols.ObjectID[protocols.XdgSurface],
	surfaceID protocols.ObjectID[protocols.WlSurface],
)

Source from the content-addressed store, hash-verified

26}
27
28func (x *XdgWmBase) XdgWmBase_get_xdg_surface(
29 s protocols.ClientState,
30 objectID protocols.ObjectID[protocols.XdgWmBase],
31 xdgSurfaceID protocols.ObjectID[protocols.XdgSurface],
32 surfaceID protocols.ObjectID[protocols.WlSurface],
33) {
34 surface := GetWlSurfaceObject(s, surfaceID)
35 if surface == nil {
36 SendError(s, objectID, protocols.XdgWmBaseError_enum_role, "surface not found")
37 return
38 }
39
40 if surface.Role != nil {
41 /**
42 * It is illegal to create an xdg_surface for a wl_surface which already has
43 * a assigned role
44 */
45 fmt.Printf("XdgWmBase_get_xdg_surface: surface@%d already has a role\n", surfaceID)
46 SendError(s,
47 objectID,
48 protocols.XdgWmBaseError_enum_role,
49 "surface already has a role",
50 )
51 return
52 }
53
54 surface.XdgSurfaceState = &xdgSurfaceID
55
56 // surface.xdg_surface_state = {
57 // on_configure: new Map(),
58 // latest_configure_serial: 0,
59 // xdg_surface_id: xdg_surface_id,
60 // window_geometry: { x: 0, y: 0, width: 0, height: 0 },
61 // };
62
63 RegisterRoleToSurface(s, xdgSurfaceID, surfaceID)
64
65 AddObject(s, xdgSurfaceID, MakeXdgSurface(x.Version, xdgSurfaceID))
66}
67
68func (x *XdgWmBase) XdgWmBase_pong(
69 _ protocols.ClientState,

Callers

nothing calls this directly

Calls 4

SendErrorFunction · 0.85
RegisterRoleToSurfaceFunction · 0.85
AddObjectFunction · 0.85
MakeXdgSurfaceFunction · 0.85

Tested by

no test coverage detected