From 48eb2e0d6fd756ec181b722c526f13453fa9c123 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 30 Aug 2022 12:46:17 +0200 Subject: Added window dimming --- src/events/Windows.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 93ad18e5..5f0110ed 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -48,6 +48,7 @@ void Events::listener_mapWindow(void* owner, void* data) { static auto *const PINACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:inactive_opacity")->floatValue; static auto *const PACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:active_opacity")->floatValue; + static auto *const PDIMSTRENGTH = &g_pConfigManager->getConfigValuePtr("decoration:dim_strength")->floatValue; const auto PMONITOR = g_pCompositor->getMonitorFromCursor(); const auto PWORKSPACE = PMONITOR->specialWorkspaceOpen ? g_pCompositor->getWorkspaceByID(SPECIAL_WORKSPACE_ID) : g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace); @@ -282,8 +283,11 @@ void Events::listener_mapWindow(void* owner, void* data) { if (!PWINDOW->m_bNoFocus && !PWINDOW->m_bNoInitialFocus && PWINDOW->m_iX11Type != 2) { g_pCompositor->focusWindow(PWINDOW); PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PACTIVEALPHA); - } else + PWINDOW->m_fDimPercent.setValueAndWarp(*PDIMSTRENGTH); + } else { PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PINACTIVEALPHA); + PWINDOW->m_fDimPercent.setValueAndWarp(0); + } Debug::log(LOG, "Window got assigned a surfaceTreeNode %x", PWINDOW->m_pSurfaceTree); -- cgit v1.2.3