layers.c: allow layer surfaces on disabled outputs

4f8b80700e added a check for the output
being enabled when creating a layershell surface with automatic output
selection. This causes labwc to send a `layer_surface.close()` and
`wl_surface.destroy()` to layershell clients when creating a new
layershell surface on a disabled output which is still part of the layout
(e.g. `wlopm --off`).

This MR replaces the `output_is_usable()` check with a dedicated check,
bypassing the check for the output being enabled.

Fixes: #3410
Reported-By: coruja
This commit is contained in:
Consolatis 2026-03-02 08:58:31 +01:00 committed by John Lindgren
parent 079b3b8a10
commit 628e667d4b

View file

@ -687,7 +687,14 @@ handle_new_layer_surface(struct wl_listener *listener, void *data)
if (!layer_surface->output) {
struct output *output = output_nearest_to_cursor(server);
if (!output_is_usable(output)) {
if (!output || !output->scene_output) {
/*
* We are not using output_is_usable() here because
* it also checks if the output is enabled which is
* not the case when wlopm is used. Thus we allow
* layer surfaces to spawn on disabled outputs as
* long as it is part of the scene layout.
*/
wlr_log(WLR_INFO,
"No output available to assign layer surface");
wlr_layer_surface_v1_destroy(layer_surface);