mirror of
https://github.com/swaywm/sway.git
synced 2025-11-11 13:29:51 -05:00
layer_shell: order destroying before sway_output
Both sway_output and sway_layer_shell listen to wlr's output destroy event, but sway_layer_shell needs to access into sway_output's data strucure and needs to be destroyed first. Resolve this by making sway_layer_shell listen to a new event that happens at start of sway_output's destroy handler
This commit is contained in:
parent
08800c8ee2
commit
6856866a61
3 changed files with 10 additions and 4 deletions
|
|
@ -352,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;
|
||||
|
|
@ -368,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue