fix exclusive zone of unmapped layer surfaces

Fixes: https://github.com/djpohly/dwl/issues/302
This commit is contained in:
Leonardo Hernández Hernández 2022-09-10 18:41:39 -05:00
parent 9bcef3d040
commit 1bb9c4583a
No known key found for this signature in database
GPG key ID: E538897EE11B9624

6
dwl.c
View file

@ -522,7 +522,8 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
const uint32_t both_vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP const uint32_t both_vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
| ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
if (wlr_layer_surface->mapped && exclusive != (state->exclusive_zone > 0)) if (!((LayerSurface *)wlr_layer_surface->data)->mapped
|| exclusive != (state->exclusive_zone > 0))
continue; continue;
bounds = state->exclusive_zone == -1 ? full_area : *usable_area; bounds = state->exclusive_zone == -1 ? full_area : *usable_area;
@ -901,6 +902,7 @@ createlayersurface(struct wl_listener *listener, void *data)
*/ */
old_state = wlr_layer_surface->current; old_state = wlr_layer_surface->current;
wlr_layer_surface->current = wlr_layer_surface->pending; wlr_layer_surface->current = wlr_layer_surface->pending;
layersurface->mapped = 1;
arrangelayers(layersurface->mon); arrangelayers(layersurface->mon);
wlr_layer_surface->current = old_state; wlr_layer_surface->current = old_state;
} }
@ -2312,7 +2314,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
{ {
LayerSurface *layersurface = wl_container_of(listener, layersurface, unmap); LayerSurface *layersurface = wl_container_of(listener, layersurface, unmap);
layersurface->layer_surface->mapped = (layersurface->mapped = 0); layersurface->mapped = 0;
wlr_scene_node_set_enabled(layersurface->scene, 0); wlr_scene_node_set_enabled(layersurface->scene, 0);
if (layersurface->layer_surface->output if (layersurface->layer_surface->output
&& (layersurface->mon = layersurface->layer_surface->output->data)) && (layersurface->mon = layersurface->layer_surface->output->data))