summaryrefslogtreecommitdiff
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-03-28 18:10:43 -0400
committerDrew DeVault <[email protected]>2018-03-28 18:11:03 -0400
commit8d6bce02afc656bf792815ed68121f4e614cd175 (patch)
treeb28c55c464feb85c61f314a26487404fd63f4fb3 /sway/desktop/layer_shell.c
parent68cfa7ef6705c530ff28d9754c5b6cab7b429150 (diff)
Address review feedback
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index a2506d21..bd62f84a 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -192,9 +192,10 @@ void arrange_layers(struct sway_output *output) {
static void handle_output_destroy(struct wl_listener *listener, void *data) {
struct sway_layer_surface *sway_layer =
wl_container_of(listener, sway_layer, output_destroy);
- sway_layer->layer_surface->output = NULL;
wl_list_remove(&sway_layer->output_destroy.link);
wl_list_remove(&sway_layer->output_mode.link);
+ wl_list_remove(&sway_layer->output_transform.link);
+ sway_layer->layer_surface->output = NULL;
wlr_layer_surface_close(sway_layer->layer_surface);
}
@@ -240,9 +241,11 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&sway_layer->map.link);
wl_list_remove(&sway_layer->unmap.link);
wl_list_remove(&sway_layer->surface_commit.link);
- wl_list_remove(&sway_layer->output_destroy.link);
- wl_list_remove(&sway_layer->output_mode.link);
- wl_list_remove(&sway_layer->output_transform.link);
+ if (sway_layer->layer_surface->output != NULL) {
+ wl_list_remove(&sway_layer->output_destroy.link);
+ wl_list_remove(&sway_layer->output_mode.link);
+ wl_list_remove(&sway_layer->output_transform.link);
+ }
struct sway_output *output = sway_layer->layer_surface->output->data;
arrange_layers(output);
free(sway_layer);