core: verify surface roles on creation of objects

This commit is contained in:
Vaxry
2024-06-08 12:03:47 +02:00
parent 10e02076b1
commit 211353dc34
5 changed files with 55 additions and 9 deletions

View File

@@ -133,6 +133,11 @@ CWLSubcompositorResource::CWLSubcompositorResource(SP<CWlSubcompositor> resource
return;
}
if (SURF->role->role() != SURFACE_ROLE_UNASSIGNED) {
r->error(-1, "Surface already has a different role");
return;
}
SP<CWLSurfaceResource> t1Parent = nullptr;
if (PARENT->role->role() == SURFACE_ROLE_SUBSURFACE) {