mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-14 19:45:45 -07:00
@@ -150,10 +150,17 @@ void CXWM::handleUnmapNotify(xcb_unmap_notify_event_t* e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool lookupParentExists(SP<CXWaylandSurface> XSURF, SP<CXWaylandSurface> prospectiveChild) {
|
static bool lookupParentExists(SP<CXWaylandSurface> XSURF, SP<CXWaylandSurface> prospectiveChild) {
|
||||||
|
std::vector<SP<CXWaylandSurface>> visited;
|
||||||
|
|
||||||
while (XSURF->parent) {
|
while (XSURF->parent) {
|
||||||
if (XSURF->parent == prospectiveChild)
|
if (XSURF->parent == prospectiveChild)
|
||||||
return true;
|
return true;
|
||||||
|
visited.emplace_back(XSURF);
|
||||||
|
|
||||||
XSURF = XSURF->parent.lock();
|
XSURF = XSURF->parent.lock();
|
||||||
|
|
||||||
|
if (std::find(visited.begin(), visited.end(), XSURF) != visited.end())
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user