summaryrefslogtreecommitdiff
path: root/src/events/Popups.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2023-03-20 15:00:58 +0000
committerGitHub <noreply@github.com>2023-03-20 15:00:58 +0000
commit788a8f7c134a34085d683e44a328e344be6b21f3 (patch)
treebed90c82b3c3e65722b5f1f97a6d04240ad3c7fc /src/events/Popups.cpp
parentd23bbd1687a5413fb7f2c08b67692d4e64f8efef (diff)
internal: wrap wlr surfaces (#1822)
Diffstat (limited to 'src/events/Popups.cpp')
-rw-r--r--src/events/Popups.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp
index 56ce41a6..f88e6917 100644
--- a/src/events/Popups.cpp
+++ b/src/events/Popups.cpp
@@ -86,10 +86,11 @@ void Events::listener_newPopup(void* owner, void* data) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(layersurface->monitorID);
- PNEWPOPUP->popup = WLRPOPUP;
- PNEWPOPUP->lx = layersurface->position.x;
- PNEWPOPUP->ly = layersurface->position.y;
- PNEWPOPUP->monitor = PMONITOR;
+ PNEWPOPUP->popup = WLRPOPUP;
+ PNEWPOPUP->lx = layersurface->position.x;
+ PNEWPOPUP->ly = layersurface->position.y;
+ PNEWPOPUP->monitor = PMONITOR;
+ PNEWPOPUP->parentLS = layersurface;
createNewPopup(WLRPOPUP, PNEWPOPUP);
}
@@ -148,6 +149,11 @@ void Events::listener_mapPopupXDG(void* owner, void* data) {
Debug::log(LOG, "New XDG Popup mapped at %d %d", (int)PPOPUP->lx, (int)PPOPUP->ly);
+ if (PPOPUP->parentWindow)
+ PPOPUP->parentWindow->m_lPopupSurfaces.emplace_back(PPOPUP->popup->base->surface);
+ else if (PPOPUP->parentLS)
+ PPOPUP->parentLS->popupSurfaces.emplace_back(PPOPUP->popup->base->surface);
+
PPOPUP->pSurfaceTree = SubsurfaceTree::createTreeRoot(PPOPUP->popup->base->surface, addPopupGlobalCoords, PPOPUP, PPOPUP->parentWindow);
int lx = 0, ly = 0;
@@ -167,6 +173,11 @@ void Events::listener_unmapPopupXDG(void* owner, void* data) {
ASSERT(PPOPUP);
+ if (PPOPUP->parentWindow)
+ std::erase(PPOPUP->parentWindow->m_lPopupSurfaces, PPOPUP->popup->base->surface);
+ else if (PPOPUP->parentLS)
+ std::erase(PPOPUP->parentLS->popupSurfaces, PPOPUP->popup->base->surface);
+
SubsurfaceTree::destroySurfaceTree(PPOPUP->pSurfaceTree);
int lx = 0, ly = 0;