From fa82cf8afa2a9faf2da320ca9f0cfc8ab34188a7 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Tue, 19 Mar 2024 22:36:05 +0000 Subject: [PATCH] layers: unconstrain popup within usable area Helped-by: @Consolatis --- src/layers.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/layers.c b/src/layers.c index a18bc4fa..79390a65 100644 --- a/src/layers.c +++ b/src/layers.c @@ -469,6 +469,7 @@ handle_new_popup(struct wl_listener *listener, void *data) wlr_output_layout_get_box(server->output_layout, output->wlr_output, &output_box); + struct wlr_box usable = output_usable_area_in_layout_coords(output); /* * Output geometry expressed in the coordinate system of the toplevel * parent of popup. We store this struct the lab_layer_popup struct @@ -476,10 +477,10 @@ handle_new_popup(struct wl_listener *listener, void *data) * the bottom to the top layer. */ struct wlr_box output_toplevel_sx_box = { - .x = output_box.x - lx, - .y = output_box.y - ly, - .width = output_box.width, - .height = output_box.height, + .x = usable.x - lx, + .y = usable.y - ly, + .width = usable.width, + .height = usable.height, }; struct lab_layer_popup *popup = create_popup(wlr_popup, surface->tree); popup->output_toplevel_sx_box = output_toplevel_sx_box;