move X11 transients to top on parent top

This commit is contained in:
vaxerski
2022-08-28 19:47:06 +02:00
parent c757fa54e1
commit 5da114477f
3 changed files with 45 additions and 5 deletions

View File

@@ -216,4 +216,20 @@ void CWindow::moveToWorkspace(int workspaceID) {
g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", this, PWORKSPACE->m_szName.c_str())});
}
}
}
}
CWindow* CWindow::X11TransientFor() {
if (!m_bIsX11)
return nullptr;
if (!m_uSurface.xwayland->parent)
return nullptr;
auto PPARENT = g_pCompositor->getWindowFromSurface(m_uSurface.xwayland->parent->surface);
while (PPARENT->m_uSurface.xwayland->parent) {
PPARENT = g_pCompositor->getWindowFromSurface(PPARENT->m_uSurface.xwayland->parent->surface);
}
return PPARENT;
}