diff options
author | Vaxry <[email protected]> | 2024-10-14 00:24:32 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-10-14 00:24:32 +0100 |
commit | abfd550ee228ea23058039790e792b45d2467c8d (patch) | |
tree | c8710c5d7f5acd870f8298d72c6fab8a00d45eca /src/xwayland | |
parent | 8e51a36c7fd500e865e34f08ab4dc4331dca59cf (diff) | |
download | Hyprland-abfd550ee228ea23058039790e792b45d2467c8d.tar.gz Hyprland-abfd550ee228ea23058039790e792b45d2467c8d.zip |
xwm: avoid infinite parent lookup loop in lookupParentExists
ref #8045
Diffstat (limited to 'src/xwayland')
-rw-r--r-- | src/xwayland/XWM.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp index dcb22eae..248813bf 100644 --- a/src/xwayland/XWM.cpp +++ b/src/xwayland/XWM.cpp @@ -150,10 +150,17 @@ void CXWM::handleUnmapNotify(xcb_unmap_notify_event_t* e) { } static bool lookupParentExists(SP<CXWaylandSurface> XSURF, SP<CXWaylandSurface> prospectiveChild) { + std::vector<SP<CXWaylandSurface>> visited; + while (XSURF->parent) { if (XSURF->parent == prospectiveChild) return true; + visited.emplace_back(XSURF); + XSURF = XSURF->parent.lock(); + + if (std::find(visited.begin(), visited.end(), XSURF) != visited.end()) + return false; } return false; |