sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 9abac85888da4b57a2cc708017318fee100e8b16
parent d0b9701820bd92e008e73693d5e61d672372e7e1
Author: emersion <contact@emersion.fr>
Date:   Thu, 10 Jan 2019 09:20:07 +0100

Merge pull request #3399 from RedSoxFan/fix-output-destruction-segfaults

Fix segfaults on output destruction
Diffstat:
Msway/input/cursor.c | 4++++
Msway/tree/output.c | 2+-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/sway/input/cursor.c b/sway/input/cursor.c @@ -85,6 +85,10 @@ static struct sway_node *node_at_coords( return NULL; } struct sway_output *output = wlr_output->data; + if (!output) { + // output is being destroyed + return NULL; + } double ox = lx, oy = ly; wlr_output_layout_output_coords(root->output_layout, wlr_output, &ox, &oy); diff --git a/sway/tree/output.c b/sway/tree/output.c @@ -58,6 +58,7 @@ struct sway_output *output_create(struct wlr_output *wlr_output) { wlr_output->data = output; wl_signal_add(&wlr_output->events.destroy, &output->destroy); + wl_signal_init(&output->events.destroy); wl_list_insert(&root->all_outputs, &output->link); @@ -76,7 +77,6 @@ void output_enable(struct sway_output *output, struct output_config *oc) { for (size_t i = 0; i < len; ++i) { wl_list_init(&output->layers[i]); } - wl_signal_init(&output->events.destroy); output->enabled = true; list_add(root->outputs, output);