diff options
| author | Felix Dick <felix.dick@web.de> | 2022-10-10 01:46:22 +0200 |
|---|---|---|
| committer | Felix Dick <felix.dick@web.de> | 2022-10-10 02:45:40 +0200 |
| commit | 7e781f24c5140e3554a45ff236a339647fba1c34 (patch) | |
| tree | 4c4effecfdc5192387eb80c033e09e6f8719e171 /src/helpers/SubsurfaceTree.cpp | |
| parent | 3bf7c5aea1d20cc6a0fc95f920111548e7863af9 (diff) | |
| parent | cb687c208c116ea870f827d8b2ee963655599f1f (diff) | |
Merge branch 'main' into simplify_matrix_calculations
Diffstat (limited to 'src/helpers/SubsurfaceTree.cpp')
| -rw-r--r-- | src/helpers/SubsurfaceTree.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp index a5c7f0a0..349f5090 100644 --- a/src/helpers/SubsurfaceTree.cpp +++ b/src/helpers/SubsurfaceTree.cpp @@ -178,19 +178,23 @@ void Events::listener_unmapSubsurface(void* owner, void* data) { if (subsurface->pChild) { const auto PNODE = subsurface->pChild; - int lx = 0, ly = 0; - addSurfaceGlobalOffset(PNODE, &lx, &ly); + const auto IT = std::find_if(SubsurfaceTree::surfaceTreeNodes.begin(), SubsurfaceTree::surfaceTreeNodes.end(), [&](const SSurfaceTreeNode& other) { return &other == PNODE; }); - wlr_box extents = {lx, ly, 0, 0}; - if (PNODE->pSurface) { - extents.width = PNODE->pSurface->current.width; - extents.height = PNODE->pSurface->current.height; + if (IT != SubsurfaceTree::surfaceTreeNodes.end()) { + int lx = 0, ly = 0; + addSurfaceGlobalOffset(PNODE, &lx, &ly); - g_pHyprRenderer->damageBox(&extents); - } + wlr_box extents = {lx, ly, 0, 0}; + if (PNODE->pSurface) { + extents.width = PNODE->pSurface->current.width; + extents.height = PNODE->pSurface->current.height; - //SubsurfaceTree::destroySurfaceTree(subsurface->pChild); - //subsurface->pChild = nullptr; + g_pHyprRenderer->damageBox(&extents); + } + + // SubsurfaceTree::destroySurfaceTree(subsurface->pChild); + // subsurface->pChild = nullptr; + } } } |
