summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@proton.me>2023-11-25 12:49:52 -0600
committerLeonardo Hernández Hernández <leohdz172@proton.me>2023-11-25 19:17:32 -0600
commitb100b446b8c82bc2dcdbb40856ab87ed4a4ad594 (patch)
treea471c61a04a96b83c246e184014f7a136b76d461
parent9cb1ece6ccecaa49462160816afb24cbbb43e87b (diff)
return early if a layersurface didn't commit something
-rw-r--r--dwl.c10
1 files 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);
}