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
1 changed files with 4 additions and 2 deletions

View File

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