better subsurface handling on unmaps

This commit is contained in:
vaxerski 2022-10-09 17:23:12 +01:00
parent 0743dab3f0
commit 881f828250

View file

@ -178,6 +178,9 @@ void Events::listener_unmapSubsurface(void* owner, void* data) {
if (subsurface->pChild) {
const auto PNODE = subsurface->pChild;
const auto IT = std::find_if(SubsurfaceTree::surfaceTreeNodes.begin(), SubsurfaceTree::surfaceTreeNodes.end(), [&](const SSurfaceTreeNode& other) { return &other == PNODE; });
if (IT != SubsurfaceTree::surfaceTreeNodes.end()) {
int lx = 0, ly = 0;
addSurfaceGlobalOffset(PNODE, &lx, &ly);
@ -189,8 +192,9 @@ void Events::listener_unmapSubsurface(void* owner, void* data) {
g_pHyprRenderer->damageBox(&extents);
}
//SubsurfaceTree::destroySurfaceTree(subsurface->pChild);
//subsurface->pChild = nullptr;
// SubsurfaceTree::destroySurfaceTree(subsurface->pChild);
// subsurface->pChild = nullptr;
}
}
}