summaryrefslogtreecommitdiff
path: root/src/layout/MasterLayout.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-01 12:57:37 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-01 12:57:37 +0200
commit60c16f77a64ef1e992f7aa7476b2e52847d18c25 (patch)
treed5f6178e1c0027168e40d8611384fb8a86933fa5 /src/layout/MasterLayout.cpp
parentf892387b7020ce27dbcf370244e26e09c9ecc1e5 (diff)
added master:no_gaps_when_only
Diffstat (limited to 'src/layout/MasterLayout.cpp')
-rw-r--r--src/layout/MasterLayout.cpp17
1 files changed, 15 insertions, 2 deletions
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);