diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 4d24842b..a02b8dba 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -460,7 +460,7 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(const CTexture& tex, wlr_b bool allowCustomUV, bool allowDim) { RASSERT(m_RenderData.pMonitor, "Tried to render texture without begin()!"); RASSERT((tex.m_iTexID > 0), "Attempted to draw NULL texture!"); - + alpha = std::clamp(alpha, 0.f, 1.f); if (!pixman_region32_not_empty(m_RenderData.pDamage)) @@ -733,17 +733,18 @@ void CHyprOpenGLImpl::preRender(CMonitor* pMonitor) { if (pWindow->m_sAdditionalConfigData.forceNoBlur) return false; - const auto PSURFACE = g_pXWaylandManager->getWindowSurface(pWindow); + const auto PSURFACE = g_pXWaylandManager->getWindowSurface(pWindow); - if (PSURFACE->opaque) - return false; - - pixman_region32_t inverseOpaque; - pixman_region32_init(&inverseOpaque); const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); const float A = pWindow->m_fAlpha.fl() * pWindow->m_fActiveInactiveAlpha.fl() * PWORKSPACE->m_fAlpha.fl(); if (A >= 1.f) { + if (PSURFACE->opaque) + return false; + + pixman_region32_t inverseOpaque; + pixman_region32_init(&inverseOpaque); + pixman_box32_t surfbox = {0, 0, PSURFACE->current.width, PSURFACE->current.height}; pixman_region32_copy(&inverseOpaque, &PSURFACE->current.opaque); pixman_region32_inverse(&inverseOpaque, &inverseOpaque, &surfbox); @@ -753,9 +754,9 @@ void CHyprOpenGLImpl::preRender(CMonitor* pMonitor) { pixman_region32_fini(&inverseOpaque); return false; } - } - pixman_region32_fini(&inverseOpaque); + pixman_region32_fini(&inverseOpaque); + } return true; };