From 60c16f77a64ef1e992f7aa7476b2e52847d18c25 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 1 Aug 2022 12:57:37 +0200 Subject: added master:no_gaps_when_only --- src/layout/MasterLayout.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/layout/MasterLayout.cpp') diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 0599d573..edff28d0 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -206,14 +206,27 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) { return; } + static auto *const PNOGAPSWHENONLY = &g_pConfigManager->getConfigValuePtr("master:no_gaps_when_only")->intValue; + PWINDOW->m_vSize = pNode->size; PWINDOW->m_vPosition = pNode->position; - // TODO: special - auto calcPos = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE); auto calcSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * BORDERSIZE); + if (*PNOGAPSWHENONLY && PWINDOW->m_iWorkspaceID != SPECIAL_WORKSPACE_ID && getNodesOnWorkspace(PWINDOW->m_iWorkspaceID) == 1) { + PWINDOW->m_vRealPosition = calcPos; + PWINDOW->m_vRealSize = calcSize; + + PWINDOW->updateWindowDecos(); + + PWINDOW->m_sSpecialRenderData.rounding = false; + + return; + } + + PWINDOW->m_sSpecialRenderData.rounding = true; + const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? GAPSOUT : GAPSIN, DISPLAYTOP ? GAPSOUT : GAPSIN); -- cgit v1.2.3