aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-16 23:08:17 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-16 23:08:17 -0600
commit294fb324d8f67c33552b15d3f1f79fe524d5f8fd (patch)
tree3f279bf3efb9af7da0fc7bfa28c66de1b4951d03 /dwl.c
parent2768af5a9bfd7cb5f874a8d61f4bc9a1188b82fd (diff)
constraint popups to its parent client
Closes: #146 Closes: #155
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index 09ddc9a..58f1b36 100644
--- a/dwl.c
+++ b/dwl.c
@@ -880,7 +880,14 @@ createnotify(struct wl_listener *listener, void *data)
struct wlr_xdg_surface *xdg_surface = data;
Client *c;
- if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL)
+ if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
+ struct wlr_box box;
+ if (!(c = client_from_popup(xdg_surface->popup)))
+ return;
+ client_get_geometry(c, &box);
+ wlr_xdg_popup_unconstrain_from_box(xdg_surface->popup, &box);
+ return;
+ } else if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_NONE)
return;
/* Allocate a Client for this surface */