mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
src/layers.c: prevent crash with no outputs available
This commit is contained in:
parent
e9aac4ce8f
commit
cd645318e7
1 changed files with 6 additions and 5 deletions
11
src/layers.c
11
src/layers.c
|
|
@ -316,6 +316,12 @@ handle_new_layer_surface(struct wl_listener *listener, void *data)
|
|||
struct wlr_output *output = wlr_output_layout_output_at(
|
||||
server->output_layout, server->seat.cursor->x,
|
||||
server->seat.cursor->y);
|
||||
if (!output) {
|
||||
wlr_log(WLR_INFO,
|
||||
"No output available to assign layer surface");
|
||||
wlr_layer_surface_v1_destroy(layer_surface);
|
||||
return;
|
||||
}
|
||||
layer_surface->output = output;
|
||||
}
|
||||
|
||||
|
|
@ -361,11 +367,6 @@ handle_new_layer_surface(struct wl_listener *listener, void *data)
|
|||
wl_signal_add(&surface->scene_layer_surface->tree->node.events.destroy,
|
||||
&surface->node_destroy);
|
||||
|
||||
if (!output) {
|
||||
wlr_log(WLR_ERROR, "no output for layer");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Temporarily set the layer's current state to pending so that
|
||||
* it can easily be arranged.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue