summaryrefslogtreecommitdiff
path: root/src/Window.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-25 20:28:40 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-25 20:28:40 +0200
commit747ff3369d6377628e3e27e3b108c8d61cbc5733 (patch)
treef4b1e1bbc12c6ff162a18bcf94d96b9c932f1baf /src/Window.cpp
parentb46f45befab6e2aa6daba76ec04cec4286eec56b (diff)
added drop shadows
Diffstat (limited to 'src/Window.cpp')
-rw-r--r--src/Window.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Window.cpp b/src/Window.cpp
index 8476360a..fbd06417 100644
--- a/src/Window.cpp
+++ b/src/Window.cpp
@@ -1,11 +1,14 @@
#include "Window.hpp"
#include "Compositor.hpp"
+#include "render/decorations/CHyprDropShadowDecoration.hpp"
CWindow::CWindow() {
m_vRealPosition.create(AVARTYPE_VECTOR, &g_pConfigManager->getConfigValuePtr("animations:windows_speed")->floatValue, &g_pConfigManager->getConfigValuePtr("animations:windows")->intValue, &g_pConfigManager->getConfigValuePtr("animations:windows_curve")->strValue, (void*) this, AVARDAMAGE_ENTIRE);
m_vRealSize.create(AVARTYPE_VECTOR, &g_pConfigManager->getConfigValuePtr("animations:windows_speed")->floatValue, &g_pConfigManager->getConfigValuePtr("animations:windows")->intValue, &g_pConfigManager->getConfigValuePtr("animations:windows_curve")->strValue, (void*)this, AVARDAMAGE_ENTIRE);
m_cRealBorderColor.create(AVARTYPE_COLOR, &g_pConfigManager->getConfigValuePtr("animations:borders_speed")->floatValue, &g_pConfigManager->getConfigValuePtr("animations:borders")->intValue, &g_pConfigManager->getConfigValuePtr("animations:borders_curve")->strValue, (void*)this, AVARDAMAGE_BORDER);
m_fAlpha.create(AVARTYPE_FLOAT, &g_pConfigManager->getConfigValuePtr("animations:fadein_speed")->floatValue, &g_pConfigManager->getConfigValuePtr("animations:fadein")->intValue, &g_pConfigManager->getConfigValuePtr("animations:fadein_curve")->strValue, (void*)this, AVARDAMAGE_ENTIRE);
+
+ m_dWindowDecorations.emplace_back(std::make_unique<CHyprDropShadowDecoration>(this)); // put the shadow so it's the first deco (has to be rendered first)
}
CWindow::~CWindow() {
@@ -16,8 +19,9 @@ CWindow::~CWindow() {
}
wlr_box CWindow::getFullWindowBoundingBox() {
+ static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
- SWindowDecorationExtents maxExtents;
+ SWindowDecorationExtents maxExtents = {{*PBORDERSIZE + 1, *PBORDERSIZE + 1}, {*PBORDERSIZE + 1, *PBORDERSIZE + 1}};
for (auto& wd : m_dWindowDecorations) {