diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-12 13:40:55 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-07-12 13:40:55 +0200 |
| commit | a4f82491b7e825255253a1fbea509e823b73115b (patch) | |
| tree | c805773577cc214f7d2d6afad313d191b04a0aa0 /src/events/Windows.cpp | |
| parent | da83ef7b96fdee7396382712f9f2115ef4664666 (diff) | |
active opacity is now animated
Diffstat (limited to 'src/events/Windows.cpp')
| -rw-r--r-- | src/events/Windows.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index bbd7421a..71f1775f 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -32,6 +32,9 @@ void addViewCoords(void* pWindow, int* x, int* y) { void Events::listener_mapWindow(void* owner, void* data) { CWindow* PWINDOW = (CWindow*)owner; + static auto *const PINACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:inactive_opacity")->floatValue; + static auto *const PACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:active_opacity")->floatValue; + const auto PMONITOR = g_pCompositor->getMonitorFromCursor(); const auto PWORKSPACE = PMONITOR->specialWorkspaceOpen ? g_pCompositor->getWorkspaceByID(SPECIAL_WORKSPACE_ID) : g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace); PWINDOW->m_iMonitorID = PMONITOR->ID; @@ -235,8 +238,11 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_vPseudoSize = PWINDOW->m_vRealSize.goalv() - Vector2D(10,10); } - if (!PWINDOW->m_bNoFocus && !PWINDOW->m_bNoInitialFocus && PWINDOW->m_iX11Type != 2) + if (!PWINDOW->m_bNoFocus && !PWINDOW->m_bNoInitialFocus && PWINDOW->m_iX11Type != 2) { g_pCompositor->focusWindow(PWINDOW); + PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PACTIVEALPHA); + } else + PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PINACTIVEALPHA); Debug::log(LOG, "Window got assigned a surfaceTreeNode %x", PWINDOW->m_pSurfaceTree); |
