From 8a8877e7390fbc1f387fe931848598b5ecb5609b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 17 Apr 2022 21:44:06 +0200 Subject: [PATCH] Added active/inactive opacity --- src/config/ConfigManager.cpp | 2 ++ src/render/Renderer.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 3a093a29..d6edc672 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -29,6 +29,8 @@ CConfigManager::CConfigManager() { configValues["decoration:blur"].intValue = 1; configValues["decoration:blur_size"].intValue = 8; configValues["decoration:blur_passes"].intValue = 1; + configValues["decoration:active_opacity"].floatValue = 1; + configValues["decoration:inactive_opacity"].floatValue = 1; configValues["dwindle:pseudotile"].intValue = 0; configValues["dwindle:col.group_border"].intValue = 0x66777700; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 77ba17fe..6bcda2b8 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -89,7 +89,7 @@ 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; + renderdata.fadeAlpha = pWindow->m_fAlpha * (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);