forked from 12to11/12to11
Fix reusing subsurfaces and XDG surfaces after roles are destroyed
* subsurface.c (DestroySubsurface): * xdg_surface.c (Destroy): Release/detach role from surface.
This commit is contained in:
parent
ef7f5537f9
commit
f83f80abd8
2 changed files with 15 additions and 0 deletions
10
subsurface.c
10
subsurface.c
|
@ -320,6 +320,16 @@ RunSurfaceActions (SurfaceAction *first)
|
||||||
static void
|
static void
|
||||||
DestroySubsurface (struct wl_client *client, struct wl_resource *resource)
|
DestroySubsurface (struct wl_client *client, struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
|
Subsurface *subsurface;
|
||||||
|
|
||||||
|
subsurface = wl_resource_get_user_data (resource);
|
||||||
|
|
||||||
|
/* Now detach the role from its surface, which can be reused in the
|
||||||
|
future. */
|
||||||
|
if (subsurface->role.surface)
|
||||||
|
XLSurfaceReleaseRole (subsurface->role.surface,
|
||||||
|
&subsurface->role);
|
||||||
|
|
||||||
wl_resource_destroy (resource);
|
wl_resource_destroy (resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -467,6 +467,11 @@ Destroy (struct wl_client *client, struct wl_resource *resource)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Now detach the role from its surface, which can be reused in the
|
||||||
|
future. */
|
||||||
|
if (role->role.surface)
|
||||||
|
XLSurfaceReleaseRole (role->role.surface, &role->role);
|
||||||
|
|
||||||
wl_resource_destroy (resource);
|
wl_resource_destroy (resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue