mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 14:45:59 +01:00
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
1 changed files with 4 additions and 2 deletions
|
@ -444,9 +444,11 @@ PHLWINDOW CWindow::X11TransientFor() {
|
|||
if (!m_pXWaylandSurface || !m_pXWaylandSurface->parent)
|
||||
return nullptr;
|
||||
|
||||
auto s = m_pXWaylandSurface->parent;
|
||||
auto s = m_pXWaylandSurface->parent;
|
||||
auto oldParent = 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;
|
||||
s = s->parent;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue