fix chromium popup on maximized window

This commit is contained in:
elviosak 2026-05-01 08:52:17 -03:00 committed by Johan Malm
parent df9537c809
commit bc7498dc6f

View file

@ -43,10 +43,13 @@ popup_unconstrain(struct xdg_popup *popup)
* than zero, typically with Qt apps. We therefore clamp it to avoid for * 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 * example the 'File' menu of a maximized window to end up on an another
* output. * 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 wlr_box *popup_box = &popup->wlr_popup->scheduled.geometry;
struct output *output = output_nearest_to(parent_lx + MAX(popup_box->x, 0), struct output *output = output_nearest_to(parent_lx + MAX(popup_box->x - 1, 0),
parent_ly + MAX(popup_box->y, 0)); parent_ly + MAX(popup_box->y - 1, 0));
struct wlr_box usable = output_usable_area_in_layout_coords(output); struct wlr_box usable = output_usable_area_in_layout_coords(output);
/* Get offset of toplevel window from its surface */ /* Get offset of toplevel window from its surface */