aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-03-24 18:44:42 +0000
committervaxerski <[email protected]>2023-03-24 18:44:42 +0000
commitb3a70b565e67ebf00bcf4ecbae54fc96e527828e (patch)
treef1e72ac1d8a96f7ba37e11855c72f61a57714758
parente73c6fd3b03492760aa3787794d16c3fcf5458bf (diff)
downloadHyprland-b3a70b565e67ebf00bcf4ecbae54fc96e527828e.tar.gz
Hyprland-b3a70b565e67ebf00bcf4ecbae54fc96e527828e.zip
subsurfaces: avoid reading destroyed surfaces
-rw-r--r--src/helpers/SubsurfaceTree.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp
index 92bfd448..43ff3be7 100644
--- a/src/helpers/SubsurfaceTree.cpp
+++ b/src/helpers/SubsurfaceTree.cpp
@@ -188,11 +188,12 @@ void Events::listener_unmapSubsurface(void* owner, void* data) {
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);
-
- wlr_box extents = {lx, ly, 0, 0};
if (PNODE->pSurface && PNODE->pSurface->exists()) {
+ int lx = 0, ly = 0;
+ addSurfaceGlobalOffset(PNODE, &lx, &ly);
+
+ wlr_box extents = {lx, ly, 0, 0};
+
extents.width = PNODE->pSurface->wlr()->current.width;
extents.height = PNODE->pSurface->wlr()->current.height;