diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-28 19:47:06 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-28 19:47:06 +0200 |
| commit | 5da114477fdb1c806f5ad6f6fbb22903481f24c1 (patch) | |
| tree | 9c0cbc69899cbacb86e9443faa889c390cdcba0c /src/Window.cpp | |
| parent | c757fa54e10bd0f486c70e32ecca366247281824 (diff) | |
move X11 transients to top on parent top
Diffstat (limited to 'src/Window.cpp')
| -rw-r--r-- | src/Window.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Window.cpp b/src/Window.cpp index f6bdf7dc..d5b24841 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -216,4 +216,20 @@ void CWindow::moveToWorkspace(int workspaceID) { g_pEventManager->postEvent(SHyprIPCEvent{"movewindow", getFormat("%x,%s", this, PWORKSPACE->m_szName.c_str())}); } } -}
\ No newline at end of file +} + +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; +} |
