From bc7498dc6ffd634a2fb3888fc79addc2373890d5 Mon Sep 17 00:00:00 2001 From: elviosak <33790211+elviosak@users.noreply.github.com> Date: Fri, 1 May 2026 08:52:17 -0300 Subject: [PATCH] fix chromium popup on maximized window --- src/xdg-popup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xdg-popup.c b/src/xdg-popup.c index 04f82f9e..8e6870af 100644 --- a/src/xdg-popup.c +++ b/src/xdg-popup.c @@ -43,10 +43,13 @@ popup_unconstrain(struct xdg_popup *popup) * than zero, typically with Qt apps. We therefore clamp it to avoid for * example the 'File' menu of a maximized window to end up on an another * output. + * Also some apps open the menu exactly at the right border when maximized, + * causing popup_box->x (or y?) to be in the next output. We subtract one + * inside MAX to avoid the problem mentioned above. */ struct wlr_box *popup_box = &popup->wlr_popup->scheduled.geometry; - struct output *output = output_nearest_to(parent_lx + MAX(popup_box->x, 0), - parent_ly + MAX(popup_box->y, 0)); + struct output *output = output_nearest_to(parent_lx + MAX(popup_box->x - 1, 0), + parent_ly + MAX(popup_box->y - 1, 0)); struct wlr_box usable = output_usable_area_in_layout_coords(output); /* Get offset of toplevel window from its surface */