From 3fe3581a5986be10e0736ea6c8ded59c7f44db5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Thu, 23 Nov 2023 14:19:10 -0600 Subject: [PATCH] chase wlr_layer_shell_v1.new_surface changes (wlroots!4265) References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4265 --- dwl.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/dwl.c b/dwl.c index de336b7..7b13087 100644 --- a/dwl.c +++ b/dwl.c @@ -707,7 +707,17 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data) LayerSurface *l = wl_container_of(listener, l, surface_commit); struct wlr_layer_surface_v1 *layer_surface = l->layer_surface; struct wlr_scene_tree *scene_layer = layers[layermap[layer_surface->current.layer]]; + struct wlr_layer_surface_v1_state old_state; + if (l->layer_surface->initial_commit) { + /* Temporarily set the layer's current state to pending + * so that we can easily arrange it */ + old_state = l->layer_surface->current; + l->layer_surface->current = l->layer_surface->pending; + arrangelayers(l->mon); + l->layer_surface->current = old_state; + return; + } if (layer_surface->current.committed == 0 && l->mapped == layer_surface->surface->mapped) return; @@ -794,7 +804,6 @@ createlayersurface(struct wl_listener *listener, void *data) LayerSurface *l; struct wlr_surface *surface = layer_surface->surface; struct wlr_scene_tree *scene_layer = layers[layermap[layer_surface->pending.layer]]; - struct wlr_layer_surface_v1_state old_state; if (!layer_surface->output && !(layer_surface->output = selmon ? selmon->wlr_output : NULL)) { @@ -819,15 +828,6 @@ createlayersurface(struct wl_listener *listener, void *data) wl_list_insert(&l->mon->layers[layer_surface->pending.layer],&l->link); wlr_surface_send_enter(surface, layer_surface->output); - - /* Temporarily set the layer's current state to pending - * so that we can easily arrange it - */ - old_state = layer_surface->current; - layer_surface->current = layer_surface->pending; - l->mapped = 1; - arrangelayers(l->mon); - layer_surface->current = old_state; } void @@ -1484,7 +1484,6 @@ locksession(struct wl_listener *listener, void *data) void maplayersurfacenotify(struct wl_listener *listener, void *data) { - LayerSurface *l = wl_container_of(listener, l, map); motionnotify(0); }