From 062f749450da9d280f85d3052d7f8bc9b70db62b Mon Sep 17 00:00:00 2001 From: Dashie Date: Wed, 1 Nov 2023 21:31:52 +0100 Subject: [PATCH] xdg: send unconstrain events after a popup reposition (#3716) * fix: Use unconstrain_from_box after reposition request * chore: Remove unused include * chore: remove variable specifier --- src/events/Popups.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp index 570963d9..559c8410 100644 --- a/src/events/Popups.cpp +++ b/src/events/Popups.cpp @@ -185,6 +185,12 @@ void Events::listener_repositionPopupXDG(void* owner, void* data) { PPOPUP->lastPos = {lx - extents.x, ly - extents.y}; PPOPUP->repositionRequested = true; + + const auto PMONITOR = g_pCompositor->m_pLastMonitor; + + wlr_box box = {PMONITOR->vecPosition.x - lx + PPOPUP->popup->current.geometry.x, PMONITOR->vecPosition.y - ly + PPOPUP->popup->current.geometry.y, PMONITOR->vecSize.x, + PMONITOR->vecSize.y}; + wlr_xdg_popup_unconstrain_from_box(PPOPUP->popup, &box); } void Events::listener_unmapPopupXDG(void* owner, void* data) {