From 91f97fc21a0da6022b221d1273e147e647ce5980 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 1 May 2018 17:18:20 +1000 Subject: Fix segfault in view_unmap() If the last remaining view on a workspace is unmapped and the workspace is not visible, parent will be a C_OUTPUT. Call the arrange_output() function in this case. --- sway/tree/view.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sway/tree/view.c') diff --git a/sway/tree/view.c b/sway/tree/view.c index e0aa6c0c..519c3c78 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -302,7 +302,11 @@ void view_unmap(struct sway_view *view) { view->swayc = NULL; view->surface = NULL; - arrange_children_of(parent); + if (parent->type == C_OUTPUT) { + arrange_output(parent); + } else { + arrange_children_of(parent); + } } void view_update_position(struct sway_view *view, double ox, double oy) { -- cgit v1.2.3-54-g00ecf