diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 4011dc06..92400f65 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -45,6 +45,9 @@ struct SRenderData { // for fade float fadeAlpha = 255.f; + + // for alpha settings + float alpha = 255.f; }; struct SKeyboard { diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 6bcda2b8..a764c38c 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -20,9 +20,9 @@ void renderSurface(struct wlr_surface* surface, int x, int y, void* data) { scaleBox(&windowBox, RDATA->output->scale); if (RDATA->surface && surface == RDATA->surface) - g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, RDATA->fadeAlpha, RDATA->dontRound ? 0 : g_pConfigManager->getInt("decoration:rounding")); + g_pHyprOpenGL->renderTextureWithBlur(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, RDATA->dontRound ? 0 : g_pConfigManager->getInt("decoration:rounding")); else - g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha, RDATA->dontRound ? 0 : g_pConfigManager->getInt("decoration:rounding")); + g_pHyprOpenGL->renderTexture(TEXTURE, &windowBox, RDATA->fadeAlpha * RDATA->alpha, RDATA->dontRound ? 0 : g_pConfigManager->getInt("decoration:rounding")); wlr_surface_send_frame_done(surface, RDATA->when); @@ -89,7 +89,8 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, SMonitor* pMonitor, timespec* renderdata.w = pWindow->m_vRealSize.x; renderdata.h = pWindow->m_vRealSize.y; renderdata.dontRound = pWindow->m_bIsFullscreen; - renderdata.fadeAlpha = pWindow->m_fAlpha * (pWindow == g_pCompositor->m_pLastWindow ? g_pConfigManager->getFloat("decoration:active_opacity") : g_pConfigManager->getFloat("decoration:inactive_opacity")); + renderdata.fadeAlpha = pWindow->m_fAlpha; + renderdata.alpha = pWindow == g_pCompositor->m_pLastWindow ? g_pConfigManager->getFloat("decoration:active_opacity") : g_pConfigManager->getFloat("decoration:inactive_opacity"); wlr_surface_for_each_surface(g_pXWaylandManager->getWindowSurface(pWindow), renderSurface, &renderdata); diff --git a/src/render/Shaders.hpp b/src/render/Shaders.hpp index 0263f22f..719c0c4a 100644 --- a/src/render/Shaders.hpp +++ b/src/render/Shaders.hpp @@ -53,7 +53,7 @@ void main() { vec4 pixColor = texture2D(tex, v_texcoord); - if (discardOpaque == 1 && pixColor[3] == 1.0) { + if (discardOpaque == 1 && pixColor[3] * alpha == 1.0) { discard; return; } @@ -111,7 +111,7 @@ uniform int discardOpaque; void main() { - if (discardOpaque == 1) { + if (discardOpaque == 1 && alpha == 1.0) { discard; return; } @@ -274,7 +274,7 @@ void main() { vec4 pixColor = texture2D(texture0, v_texcoord); - if (discardOpaque == 1 && pixColor[3] == 1.0) { + if (discardOpaque == 1 && pixColor[3] * alpha == 1.0) { discard; return; }