aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-17 19:17:28 -0400
committerDrew DeVault <sir@cmpwn.com>2018-03-27 18:50:09 -0400
commit4a8c0c078445184a5d14725a0fb6df0cfc7ca5c9 (patch)
treebfde03520fc7d8d26fd1fa2f4437cdec956b45eb
parentb06105b564541680ef2feb27eef626aaca4852c0 (diff)
Destroy layer surfaces when client is destroyed
-rw-r--r--types/wlr_layer_shell.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c
index 055578bd..709d3cbc 100644
--- a/types/wlr_layer_shell.c
+++ b/types/wlr_layer_shell.c
@@ -235,7 +235,10 @@ static struct zwlr_layer_shell_v1_interface layer_shell_impl = {
static void wlr_layer_client_destroy(struct wl_resource *resource) {
struct wlr_layer_client *client = layer_client_from_resource(resource);
- // TODO: Destroy surfaces
+ struct wlr_layer_surface *surface, *tmp = NULL;
+ wl_list_for_each_safe(surface, tmp, &client->surfaces, link) {
+ layer_surface_destroy(surface);
+ }
wl_list_remove(&client->link);
free(client);