mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 04:09:49 +01:00
added master:no_gaps_when_only
This commit is contained in:
parent
f892387b70
commit
60c16f77a6
3 changed files with 18 additions and 4 deletions
|
@ -92,6 +92,7 @@ void CConfigManager::setDefaultVars() {
|
||||||
configValues["master:special_scale_factor"].floatValue = 0.8f;
|
configValues["master:special_scale_factor"].floatValue = 0.8f;
|
||||||
configValues["master:new_is_master"].intValue = 1;
|
configValues["master:new_is_master"].intValue = 1;
|
||||||
configValues["master:new_on_top"].intValue = 0;
|
configValues["master:new_on_top"].intValue = 0;
|
||||||
|
configValues["master:no_gaps_when_only"].intValue = 0;
|
||||||
|
|
||||||
configValues["animations:enabled"].intValue = 1;
|
configValues["animations:enabled"].intValue = 1;
|
||||||
configValues["animations:speed"].floatValue = 7.f;
|
configValues["animations:speed"].floatValue = 7.f;
|
||||||
|
|
|
@ -206,14 +206,27 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static auto *const PNOGAPSWHENONLY = &g_pConfigManager->getConfigValuePtr("master:no_gaps_when_only")->intValue;
|
||||||
|
|
||||||
PWINDOW->m_vSize = pNode->size;
|
PWINDOW->m_vSize = pNode->size;
|
||||||
PWINDOW->m_vPosition = pNode->position;
|
PWINDOW->m_vPosition = pNode->position;
|
||||||
|
|
||||||
// TODO: special
|
|
||||||
|
|
||||||
auto calcPos = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE);
|
auto calcPos = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE);
|
||||||
auto calcSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * 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,
|
const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? GAPSOUT : GAPSIN,
|
||||||
DISPLAYTOP ? GAPSOUT : GAPSIN);
|
DISPLAYTOP ? GAPSOUT : GAPSIN);
|
||||||
|
|
||||||
|
|
|
@ -197,11 +197,11 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec*
|
||||||
renderdata.surface = g_pXWaylandManager->getWindowSurface(pWindow);
|
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.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.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.fadeAlpha = pWindow->m_fAlpha.fl() * (PWORKSPACE->m_fAlpha.fl() / 255.f);
|
||||||
renderdata.alpha = pWindow->m_fActiveInactiveAlpha.fl();
|
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.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
|
renderdata.blur = true; // if it shouldn't, it will be ignored later
|
||||||
|
|
||||||
// apply window special data
|
// apply window special data
|
||||||
|
|
Loading…
Reference in a new issue