From 9ad4a96d18fb78eb76d1d32f07e501ba512bcc73 Mon Sep 17 00:00:00 2001 From: memchr <118117622+memchr@users.noreply.github.com> Date: Mon, 21 Aug 2023 18:55:57 +0000 Subject: [PATCH] renderer: update alpha of layers only if active ws (#2994) update `alpha` of ZWLR_LAYER_SHELL_V1_LAYER_TOP only when Workspaces is active on the monitor. --- src/Compositor.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 44d7c89e..2f9da567 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2087,9 +2087,11 @@ void CCompositor::updateFullscreenFadeOnWorkspace(CWorkspace* pWorkspace) { const auto PMONITOR = getMonitorFromID(pWorkspace->m_iMonitorID); - for (auto& ls : PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) { - if (!ls->fadingOut) - ls->alpha = FULLSCREEN && pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL ? 0.f : 1.f; + if (pWorkspace->m_iID == PMONITOR->activeWorkspace) { + for (auto& ls : PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) { + if (!ls->fadingOut) + ls->alpha = FULLSCREEN && pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL ? 0.f : 1.f; + } } }