mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-15 11:25:59 +01:00
parent
8e51a36c7f
commit
abfd550ee2
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue