diff options
author | Drew DeVault <[email protected]> | 2018-03-28 18:10:43 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2018-03-28 18:11:03 -0400 |
commit | 8d6bce02afc656bf792815ed68121f4e614cd175 (patch) | |
tree | b28c55c464feb85c61f314a26487404fd63f4fb3 /sway/desktop/layer_shell.c | |
parent | 68cfa7ef6705c530ff28d9754c5b6cab7b429150 (diff) |
Address review feedback
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r-- | sway/desktop/layer_shell.c | 11 |
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); |