summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-07-24 16:43:13 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-07-24 16:43:13 -0500
commit7eee0a8229f2debed4ca552d0de5d7fe8a5721a5 (patch)
treeb7fb6ac40232b313b37273b12755482c83625d05
parentb04c73be3de62d2739b5bb85e40f0c9af1122903 (diff)
use the layer surface to create popups
-rw-r--r--dwl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/dwl.c b/dwl.c
index 7886b64..42cd806 100644
--- a/dwl.c
+++ b/dwl.c
@@ -967,18 +967,17 @@ 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);
+ LayerSurface *l = toplevel_from_popup(xdg_surface->popup);
xdg_surface->surface->data = wlr_scene_xdg_surface_create(
xdg_surface->popup->parent->data, xdg_surface);
- if (wlr_surface_is_layer_surface(xdg_surface->popup->parent) && (l = toplevel)
+ if (wlr_surface_is_layer_surface(xdg_surface->popup->parent) && l
&& 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)
+ if (!l || !l->mon)
return;
- box = c->type == LayerShell ? c->mon->m : c->mon->w;
- box.x -= c->geom.x;
- box.y -= c->geom.y;
+ box = l->type == LayerShell ? l->mon->m : l->mon->w;
+ box.x -= l->geom.x;
+ box.y -= l->geom.y;
wlr_xdg_popup_unconstrain_from_box(xdg_surface->popup, &box);
return;
} else if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_NONE)