summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-06-24 14:46:08 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-06-24 14:46:08 -0500
commit549335ae5458834f91a59ee14f385d17b2d4f888 (patch)
tree21f32eeb49c00c23a1a0b5259241e2356dcfde04
parent097b4a30f5906fb45ce805115dd9dde48aefe60e (diff)
avoid layer surface popups appearing below x{dg,wayland} clients
-rw-r--r--dwl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index 5f4d5fd..0d4163e 100644
--- a/dwl.c
+++ b/dwl.c
@@ -952,9 +952,14 @@ createnotify(struct wl_listener *listener, void *data)
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
struct wlr_box box;
+ LayerSurface *l;
+ void *toplevel = toplevel_from_popup(xdg_surface->popup);
xdg_surface->surface->data = wlr_scene_xdg_surface_create(
xdg_surface->popup->parent->data, xdg_surface);
- if (!(c = toplevel_from_popup(xdg_surface->popup)) || !c->mon)
+ if (wlr_surface_is_layer_surface(xdg_surface->popup->parent) && (l = toplevel)
+ && l->layer_surface->current.layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
+ wlr_scene_node_reparent(xdg_surface->surface->data, layers[LyrTop]);
+ if (!(c = toplevel) || !c->mon)
return;
box = c->type == LayerShell ? c->mon->m : c->mon->w;
box.x -= c->geom.x;