aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-06-27 13:21:00 +1000
committerGitHub <noreply@github.com>2018-06-27 13:21:00 +1000
commitbf380813829b11d42ff0703630600e5bee06098b (patch)
tree0c0951e0ec5c36a6de14535903092b539bdbbf9b /sway/desktop/layer_shell.c
parenteeb38d65cbf5c8452c449b9f5e003bd255ca6a53 (diff)
parentf0f50c31d5e40f3dbe80c60d01bafc80c3bd24c0 (diff)
Merge branch 'master' into xwayland-wants-float
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 3accdefb..b57d1ee6 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -219,6 +219,8 @@ 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);
wl_list_remove(&sway_layer->output_destroy.link);
+ wl_list_remove(&sway_layer->link);
+ wl_list_init(&sway_layer->link);
sway_layer->layer_surface->output = NULL;
wlr_layer_surface_close(sway_layer->layer_surface);
}
@@ -350,10 +352,6 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
wl_signal_add(&layer_surface->surface->events.commit,
&sway_layer->surface_commit);
- sway_layer->output_destroy.notify = handle_output_destroy;
- wl_signal_add(&layer_surface->output->events.destroy,
- &sway_layer->output_destroy);
-
sway_layer->destroy.notify = handle_destroy;
wl_signal_add(&layer_surface->events.destroy, &sway_layer->destroy);
sway_layer->map.notify = handle_map;
@@ -366,6 +364,9 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
layer_surface->data = sway_layer;
struct sway_output *output = layer_surface->output->data;
+ sway_layer->output_destroy.notify = handle_output_destroy;
+ wl_signal_add(&output->events.destroy, &sway_layer->output_destroy);
+
wl_list_insert(&output->layers[layer_surface->layer], &sway_layer->link);
// Temporarily set the layer's current state to client_pending