From d83e5b8409e92bb7e8e2b968b5fde25ac0c2171b Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 4 Jun 2023 21:29:38 +0200 Subject: [PATCH] internal: make borderSize prop overridable --- src/Window.hpp | 8 ++++---- src/debug/HyprCtl.cpp | 2 ++ src/render/Renderer.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Window.hpp b/src/Window.hpp index d609f91b..c1a36d21 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -100,10 +100,10 @@ struct SWindowSpecialRenderData { CWindowOverridableVar inactiveBorderColor = -1; // -1 means unset // set by the layout - int borderSize = -1; - bool rounding = true; - bool border = true; - bool decorate = true; + CWindowOverridableVar borderSize = -1; // -1 means unset + bool rounding = true; + bool border = true; + bool decorate = true; }; struct SWindowAdditionalConfigData { diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 1390c268..a5497bd3 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -990,6 +990,8 @@ std::string dispatchSetProp(std::string request) { PWINDOW->m_sSpecialRenderData.inactiveBorderColor.forceSetIgnoreLocked(configStringToInt(VAL), lock); } else if (PROP == "forcergbx") { PWINDOW->m_sAdditionalConfigData.forceRGBX.forceSetIgnoreLocked(configStringToInt(VAL), lock); + } else if (PROP == "bordersize") { + PWINDOW->m_sSpecialRenderData.borderSize.forceSetIgnoreLocked(configStringToInt(VAL), lock); } else { return "prop not found"; } diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index a3c1973d..7552b17c 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -345,7 +345,7 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* scaleBox(&windowBox, pMonitor->scale); - const int BORDERSIZE = pWindow->m_sSpecialRenderData.borderSize == -1 ? *PBORDERSIZE : pWindow->m_sSpecialRenderData.borderSize; + const int BORDERSIZE = pWindow->m_sSpecialRenderData.borderSize.toUnderlying() == -1 ? *PBORDERSIZE : pWindow->m_sSpecialRenderData.borderSize.toUnderlying(); g_pHyprOpenGL->renderBorder(&windowBox, grad, rounding, BORDERSIZE, a1);