diff options
author | vaxerski <[email protected]> | 2022-06-05 23:23:16 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-06-05 23:23:16 +0200 |
commit | 84a0fa0f34ccc82c1bbb961bac0dbe81c82e999c (patch) | |
tree | 9cebafa118603cac397de2f4869f99805d5c2430 | |
parent | 2cd2f8b5b5d7109577f9776996c6e7bc2713abdb (diff) | |
download | Hyprland-84a0fa0f34ccc82c1bbb961bac0dbe81c82e999c.tar.gz Hyprland-84a0fa0f34ccc82c1bbb961bac0dbe81c82e999c.zip |
fix subsurfaces not damaging on unmap
-rw-r--r-- | src/helpers/SubsurfaceTree.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp index 7ec3635a..064ca181 100644 --- a/src/helpers/SubsurfaceTree.cpp +++ b/src/helpers/SubsurfaceTree.cpp @@ -89,6 +89,20 @@ void SubsurfaceTree::destroySurfaceTree(SSurfaceTreeNode* pNode) { pNode->hyprListener_destroy.removeCallback(); pNode->hyprListener_newSubsurface.removeCallback(); + // damage + if (pNode->pSurface) { + wlr_box extents = {}; + wlr_surface_get_extends(pNode->pSurface, &extents); + + int lx = 0, ly = 0; + addSurfaceGlobalOffset(pNode, &lx, &ly); + + extents.x += lx; + extents.y += ly; + + g_pHyprRenderer->damageBox(&extents); + } + surfaceTreeNodes.remove(*pNode); Debug::log(LOG, "SurfaceTree Node removed"); @@ -162,6 +176,8 @@ void Events::listener_unmapSubsurface(void* owner, void* data) { extents.x += lx; extents.y += ly; + g_pHyprRenderer->damageBox(&extents); + SubsurfaceTree::destroySurfaceTree(subsurface->pChild); subsurface->pChild = nullptr; } |