mirror of https://github.com/hyprwm/Hyprland
xwayland: break cyclic loop of parents (#6722)
in X11 some surfaces is a parent of itself and creates a cyclic loop when trying to find its parent. check for old parent and break if its beginning to roll over.
This commit is contained in:
parent
4d6f96f74f
commit
d7ea1b7785
|
@ -445,8 +445,10 @@ PHLWINDOW CWindow::X11TransientFor() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
auto s = m_pXWaylandSurface->parent;
|
auto s = m_pXWaylandSurface->parent;
|
||||||
|
auto oldParent = s;
|
||||||
while (s) {
|
while (s) {
|
||||||
if (!s->parent)
|
// break cyclic loop of m_pXWaylandSurface being parent of itself, #TODO reject this from even being created?
|
||||||
|
if (!s->parent || s->parent == oldParent)
|
||||||
break;
|
break;
|
||||||
s = s->parent;
|
s = s->parent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue