summaryrefslogtreecommitdiff
path: root/src/events/Windows.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-30 12:46:17 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-30 12:46:17 +0200
commit48eb2e0d6fd756ec181b722c526f13453fa9c123 (patch)
tree67158a41ff97f28909adaa37e71d34865c817ed4 /src/events/Windows.cpp
parent179562b646851c06ee79fa4a5e2e7386885cee0e (diff)
Added window dimming
Diffstat (limited to 'src/events/Windows.cpp')
-rw-r--r--src/events/Windows.cpp6
1 files changed, 5 insertions, 1 deletions
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);