wayland/subsurface: Return NULL as toplevel if parent has no role
There is nothing stopping a subsurface from commiting its state before its parents role has been assigned. Thus, we need to handle meta_wayland_surface_get_toplevel() returning NULL for subsurfaces even on commit.
This commit is contained in:
parent
4cf14c41ef
commit
b3f27de710
1 changed files with 4 additions and 1 deletions
|
@ -594,7 +594,10 @@ subsurface_role_get_toplevel (MetaWaylandSurfaceRole *surface_role)
|
|||
meta_wayland_surface_role_get_surface (surface_role);
|
||||
MetaWaylandSurface *parent = surface->sub.parent;
|
||||
|
||||
return meta_wayland_surface_role_get_toplevel (parent->role);
|
||||
if (parent->role)
|
||||
return meta_wayland_surface_role_get_toplevel (parent->role);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* A non-subsurface is always desynchronized.
|
||||
|
|
Loading…
Reference in a new issue