From 59b436445e129132247e205c1480d6543d4e0097 Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Wed, 13 Sep 2023 18:20:20 +0100 Subject: [PATCH] handle rest of shadow extents modified: src/render/decorations/CHyprDropShadowDecoration.cpp modified: src/render/decorations/CHyprGroupBarDecoration.cpp Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> --- src/render/decorations/CHyprDropShadowDecoration.cpp | 9 +++------ src/render/decorations/CHyprGroupBarDecoration.cpp | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index 0c51f15e..50a60c39 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -114,12 +114,9 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D fullBox.y += ((windowBox.height + 2.0 * *PSHADOWSIZE) - NEWSIZE.y) / 2.0; } - //m_seExtents = {{m_vLastWindowPos.x - fullBox.x - pMonitor->vecPosition.x + 2, m_vLastWindowPos.y - fullBox.y - pMonitor->vecPosition.y + 2}, - // {fullBox.x + fullBox.width + pMonitor->vecPosition.x - m_vLastWindowPos.x - m_vLastWindowSize.x + 2, - // fullBox.y + fullBox.height + pMonitor->vecPosition.y - m_vLastWindowPos.y - m_vLastWindowSize.y + 2}}; - - m_seExtents.topLeft = {*PSHADOWSIZE, *PSHADOWSIZE}; - m_seExtents.bottomRight = {*PSHADOWSIZE, *PSHADOWSIZE}; + m_seExtents.topLeft = {std::max(0, windowBox.x - fullBox.x), std::max(0, windowBox.y - fullBox.y)}; + m_seExtents.bottomRight = {std::max(0, (fullBox.x + fullBox.width) - (windowBox.x + windowBox.width)), + std::max(0, (fullBox.y + fullBox.height) - (windowBox.y + windowBox.height))}; m_seExtents.isReservedArea = false; fullBox.x += offset.x; diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index d6f2e36e..b2de3af4 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -148,7 +148,8 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& glStencilFunc(GL_NOTEQUAL, 1, -1); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - g_pHyprOpenGL->renderRect(&backBox, color, ROUNDING * pMonitor->scale); + if (backBox.width > 0 && backBox.height > 0) + g_pHyprOpenGL->renderRect(&backBox, color, ROUNDING * pMonitor->scale); // cleanup stencil glClearStencil(0); @@ -156,9 +157,8 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& glDisable(GL_STENCIL_TEST); glStencilMask(-1); glStencilFunc(GL_ALWAYS, 1, 0xFF); - } else { + } else if (backBox.width > 0 && backBox.height > 0) g_pHyprOpenGL->renderRect(&backBox, color, ROUNDING * pMonitor->scale); - } } for (int i = 0; i < barsToDraw; ++i) {