diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index c6b8a634..e59c1a32 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -92,6 +92,7 @@ void CConfigManager::setDefaultVars() { configValues["master:special_scale_factor"].floatValue = 0.8f; configValues["master:new_is_master"].intValue = 1; configValues["master:new_on_top"].intValue = 0; + configValues["master:no_gaps_when_only"].intValue = 0; configValues["animations:enabled"].intValue = 1; configValues["animations:speed"].floatValue = 7.f; 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); diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 5103c92c..e46775da 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -197,11 +197,11 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* renderdata.surface = g_pXWaylandManager->getWindowSurface(pWindow); renderdata.w = std::clamp(pWindow->m_vRealSize.vec().x, (double)5, (double)1337420); // clamp the size to min 5, renderdata.h = std::clamp(pWindow->m_vRealSize.vec().y, (double)5, (double)1337420); // otherwise we'll have issues later with invalid boxes - renderdata.dontRound = pWindow->m_bIsFullscreen && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL; + renderdata.dontRound = (pWindow->m_bIsFullscreen && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) || (!pWindow->m_sSpecialRenderData.rounding); renderdata.fadeAlpha = pWindow->m_fAlpha.fl() * (PWORKSPACE->m_fAlpha.fl() / 255.f); renderdata.alpha = pWindow->m_fActiveInactiveAlpha.fl(); renderdata.decorate = decorate && !pWindow->m_bX11DoesntWantBorders && (pWindow->m_bIsFloating ? *PNOFLOATINGBORDERS == 0 : true) && (!pWindow->m_bIsFullscreen || PWORKSPACE->m_efFullscreenMode != FULLSCREEN_FULL); - renderdata.rounding = pWindow->m_sAdditionalConfigData.rounding && pWindow->m_sSpecialRenderData.rounding; + renderdata.rounding = pWindow->m_sAdditionalConfigData.rounding; renderdata.blur = true; // if it shouldn't, it will be ignored later // apply window special data