From c949173bc9c9f9e8276cba098cb82ed51ad4965b Mon Sep 17 00:00:00 2001 From: levnikmyskin Date: Mon, 1 May 2023 23:28:27 +0200 Subject: Added some workspace-specific rules (#1986) * added some workspace-specific rules * added some worskpace-specific rules, with windowrule like syntax * monitor is not mandatory anymore * pointers to config are now static * fixed optional WorkspaceRule fields * Windows can now specify border size * removed CHyprOpenGLImpl::renderBorder borderSize default value * stuff --------- Co-authored-by: Alessio Molinari Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com> --- src/render/Renderer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/render/Renderer.cpp') diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 62a0ac05..8b88c997 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -248,6 +248,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* const auto REALPOS = pWindow->m_vRealPosition.vec() + (pWindow->m_bPinned ? Vector2D{} : PWORKSPACE->m_vRenderOffset.vec()); static auto* const PNOFLOATINGBORDERS = &g_pConfigManager->getConfigValuePtr("general:no_border_on_floating")->intValue; static auto* const PDIMAROUND = &g_pConfigManager->getConfigValuePtr("decoration:dim_around")->floatValue; + static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; SRenderData renderdata = {pMonitor, time, REALPOS.x, REALPOS.y}; if (ignorePosition) { @@ -342,11 +343,13 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* scaleBox(&windowBox, pMonitor->scale); - g_pHyprOpenGL->renderBorder(&windowBox, grad, rounding, a1); + const int BORDERSIZE = pWindow->m_sSpecialRenderData.borderSize == -1 ? *PBORDERSIZE : pWindow->m_sSpecialRenderData.borderSize; + + g_pHyprOpenGL->renderBorder(&windowBox, grad, rounding, BORDERSIZE, a1); if (ANIMATED) { float a2 = renderdata.fadeAlpha * renderdata.alpha * (1.f - g_pHyprOpenGL->m_pCurrentWindow->m_fBorderFadeAnimationProgress.fl()); - g_pHyprOpenGL->renderBorder(&windowBox, g_pHyprOpenGL->m_pCurrentWindow->m_cRealBorderColorPrevious, rounding, a2); + g_pHyprOpenGL->renderBorder(&windowBox, g_pHyprOpenGL->m_pCurrentWindow->m_cRealBorderColorPrevious, rounding, BORDERSIZE, a2); } } } -- cgit v1.2.3