layer_shell: do not SIGABRT sway on zero outputs

If there are no outputs, do not SIGABRT when a layer surface is created,
just close the layer surface.
This commit is contained in:
Brian Ashworth 2019-01-16 00:44:24 -05:00 committed by emersion
parent 81e595e6e8
commit 247817f68c

View file

@ -379,8 +379,10 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
} }
} }
if (!output) { if (!output) {
if (!sway_assert(root->outputs->length, if (!root->outputs->length) {
"cannot auto-assign output for layer")) { wlr_log(WLR_ERROR,
"no output to auto-assign layer surface '%s' to",
layer_surface->namespace);
wlr_layer_surface_v1_close(layer_surface); wlr_layer_surface_v1_close(layer_surface);
return; return;
} }