diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 52b197ea..160f5e3f 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1206,10 +1206,14 @@ void CCompositor::updateWindowAnimatedDecorationValues(CWindow* pWindow) { } // shadow - if (pWindow == m_pLastWindow) { - pWindow->m_cRealShadowColor = CColor(*PSHADOWCOL); + if (pWindow->m_iX11Type != 2 && !pWindow->m_bX11DoesntWantBorders) { + if (pWindow == m_pLastWindow) { + pWindow->m_cRealShadowColor = CColor(*PSHADOWCOL); + } else { + pWindow->m_cRealShadowColor = CColor(*PSHADOWCOLINACTIVE != INT_MAX ? *PSHADOWCOLINACTIVE : *PSHADOWCOL); + } } else { - pWindow->m_cRealShadowColor = CColor(*PSHADOWCOLINACTIVE != INT_MAX ? *PSHADOWCOLINACTIVE : *PSHADOWCOL); + pWindow->m_cRealShadowColor.setValueAndWarp(CColor(0, 0, 0, 0)); // no shadow } } diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 36f0b2db..694b9a9c 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -49,6 +49,8 @@ void Events::listener_mapWindow(void* owner, void* data) { if (PWINDOW->m_iX11Type == 2) g_pCompositor->moveUnmanagedX11ToWindows(PWINDOW); + g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW); + // Set all windows tiled regardless of anything g_pXWaylandManager->setWindowStyleTiled(PWINDOW, WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM); diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index 40051942..a03181c0 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -53,6 +53,9 @@ void CHyprDropShadowDecoration::draw(SMonitor* pMonitor, float a) { if (!g_pCompositor->windowValidMapped(m_pWindow)) return; + if (m_pWindow->m_cRealShadowColor.col() == CColor(0, 0, 0, 0)) + return; // don't draw invisible shadows + static auto *const PSHADOWS = &g_pConfigManager->getConfigValuePtr("decoration:drop_shadow")->intValue; static auto *const PSHADOWSIZE = &g_pConfigManager->getConfigValuePtr("decoration:shadow_range")->intValue; static auto *const PROUNDING = &g_pConfigManager->getConfigValuePtr("decoration:rounding")->intValue;