diff options
author | Vaxry <[email protected]> | 2024-08-30 15:18:12 +0200 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-08-30 15:53:44 +0200 |
commit | 1c9d56998dbf3a9b61e13573e9e91d149fe65969 (patch) | |
tree | a9939d223d864582ae0ea8b419221534a10b27c9 /src/Compositor.cpp | |
parent | 242e06b24212b61e7afbdf5cf4adae8886a28abd (diff) | |
download | Hyprland-1c9d56998dbf3a9b61e13573e9e91d149fe65969.tar.gz Hyprland-1c9d56998dbf3a9b61e13573e9e91d149fe65969.zip |
xdg-dialog: implement new protocol
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r-- | src/Compositor.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 7ae3070d..eac75bd4 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1888,6 +1888,8 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) { pWindow->m_fBorderFadeAnimationProgress = 1.f; }; + const bool IS_SHADOWED_BY_MODAL = pWindow->m_pXDGSurface && pWindow->m_pXDGSurface->toplevel && pWindow->m_pXDGSurface->toplevel->anyChildModal(); + // border const auto RENDERDATA = g_pLayoutManager->getCurrentLayout()->requestRenderHints(pWindow); if (RENDERDATA.isBorderGradient) @@ -1921,11 +1923,16 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) { } // dim - if (pWindow == m_pLastWindow.lock() || pWindow->m_sWindowData.noDim.valueOrDefault() || !*PDIMENABLED) { - pWindow->m_fDimPercent = 0; - } else { - pWindow->m_fDimPercent = *PDIMSTRENGTH; - } + float goalDim = 1.F; + if (pWindow == m_pLastWindow.lock() || pWindow->m_sWindowData.noDim.valueOrDefault() || !*PDIMENABLED) + goalDim = 0; + else + goalDim = *PDIMSTRENGTH; + + if (IS_SHADOWED_BY_MODAL) + goalDim += (1.F - goalDim) / 2.F; + + pWindow->m_fDimPercent = goalDim; // shadow if (!pWindow->isX11OverrideRedirect() && !pWindow->m_bX11DoesntWantBorders) { |