From b100b446b8c82bc2dcdbb40856ab87ed4a4ad594 Mon Sep 17 00:00:00 2001 From: Leonardo Hernández Hernández Date: Sat, 25 Nov 2023 12:49:52 -0600 Subject: return early if a layersurface didn't commit something --- dwl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dwl.c b/dwl.c index c187df2..8d5f599 100644 --- a/dwl.c +++ b/dwl.c @@ -712,6 +712,11 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data) struct wlr_layer_surface_v1 *wlr_layer_surface = layersurface->layer_surface; struct wlr_scene_tree *layer = layers[layermap[wlr_layer_surface->current.layer]]; + if (wlr_layer_surface->current.committed == 0 + && layersurface->mapped == wlr_layer_surface->surface->mapped) + return; + layersurface->mapped = wlr_layer_surface->surface->mapped; + if (layer != layersurface->scene->node.parent) { wlr_scene_node_reparent(&layersurface->scene->node, layer); wl_list_remove(&layersurface->link); @@ -721,11 +726,6 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data) < ZWLR_LAYER_SHELL_V1_LAYER_TOP ? layers[LyrTop] : layer)); } - if (wlr_layer_surface->current.committed == 0 - && layersurface->mapped == wlr_layer_surface->surface->mapped) - return; - layersurface->mapped = wlr_layer_surface->surface->mapped; - arrangelayers(layersurface->mon); } -- cgit v1.2.3