simplify check for wlr_layer_surface.output

This commit is contained in:
Leonardo Hernández Hernández 2023-11-25 12:39:16 -06:00
parent 1f10e69b4c
commit 66ec028b00
Failed to generate hash of commit

6
dwl.c
View file

@ -807,10 +807,8 @@ createlayersurface(struct wl_listener *listener, void *data)
struct wlr_layer_surface_v1_state old_state;
struct wlr_scene_tree *l = layers[layermap[wlr_layer_surface->pending.layer]];
if (!wlr_layer_surface->output)
wlr_layer_surface->output = selmon ? selmon->wlr_output : NULL;
if (!wlr_layer_surface->output) {
if (!wlr_layer_surface->output
&& !(wlr_layer_surface->output = selmon ? selmon->wlr_output : NULL)) {
wlr_layer_surface_v1_destroy(wlr_layer_surface);
return;
}