From cd37a1533e0e86fffdd333e18bab0bb730c1dc25 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 5 Aug 2022 18:10:59 +0200 Subject: reject tiling windows that do not meet the max size requirement --- src/layout/DwindleLayout.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 6abcaf5f..f779147e 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -246,6 +246,15 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow) { OPENINGON = getFirstNodeOnWorkspace(PNODE->workspaceID); } + // first, check if OPENINGON isn't too big. + if (const auto MAXSIZE = g_pXWaylandManager->getMaxSizeForWindow(pWindow); MAXSIZE.x < OPENINGON->size.x || MAXSIZE.y < OPENINGON->size.y) { + // we can't continue. make it floating. + pWindow->m_bIsFloating = true; + m_lDwindleNodesData.remove(*PNODE); + g_pLayoutManager->getCurrentLayout()->onWindowCreatedFloating(pWindow); + return; + } + // if it's the first, it's easy. Make it fullscreen. if (!OPENINGON || OPENINGON->pWindow == pWindow) { PNODE->position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft; -- cgit v1.2.3