internal: make borderSize prop overridable

This commit is contained in:
Vaxry 2023-06-04 21:29:38 +02:00
parent df98db5092
commit d83e5b8409
3 changed files with 7 additions and 5 deletions

View file

@ -100,10 +100,10 @@ struct SWindowSpecialRenderData {
CWindowOverridableVar<int64_t> inactiveBorderColor = -1; // -1 means unset
// set by the layout
int borderSize = -1;
bool rounding = true;
bool border = true;
bool decorate = true;
CWindowOverridableVar<int> borderSize = -1; // -1 means unset
bool rounding = true;
bool border = true;
bool decorate = true;
};
struct SWindowAdditionalConfigData {

View file

@ -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";
}

View file

@ -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);