return;
if (shsurf->surface == shsurf->shell->grab_surface)
return;
+ if (!shsurf->owner)
+ return;
handle_xdg_ping(shsurf, serial);
}
wl_resource_set_implementation(shsurf->resource,
&shell_surface_implementation,
shsurf, shell_destroy_shell_surface);
- wl_list_init(wl_resource_get_link(shsurf->resource));
+ wl_list_insert(&sc->surface_list,
+ wl_resource_get_link(shsurf->resource));
}
static bool
{
struct shell_client *sc =
container_of(listener, struct shell_client, destroy_listener);
+ struct wl_resource *shsurf_resource;
+ struct shell_surface *shsurf;
if (sc->ping_timer)
wl_event_source_remove(sc->ping_timer);
* head of the surface list so we don't use that freed list node
* during surface clean up later on.
*/
+ wl_resource_for_each(shsurf_resource, &sc->surface_list) {
+ shsurf = wl_resource_get_user_data(shsurf_resource);
+ shsurf->owner = NULL;
+ }
wl_list_remove(&sc->surface_list);
free(sc);