diff options
| author | Vaxry <vaxry@vaxry.net> | 2023-11-11 15:18:04 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2023-11-11 15:18:17 +0000 |
| commit | bea828ea4585bab206b8772b838f496e0eada12e (patch) | |
| tree | fa03be2903d8270b307fa1a3e0389fe65a4bb505 /src/render/decorations/CHyprDropShadowDecoration.cpp | |
| parent | c5d1faf72dc5e7e4fa357007974ced0f573f1f32 (diff) | |
decoration-positioner: improve extent handling
Diffstat (limited to 'src/render/decorations/CHyprDropShadowDecoration.cpp')
| -rw-r--r-- | src/render/decorations/CHyprDropShadowDecoration.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index 9f051ad3..1990d37d 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -6,16 +6,20 @@ CHyprDropShadowDecoration::CHyprDropShadowDecoration(CWindow* pWindow) : IHyprWi m_pWindow = pWindow; } -CHyprDropShadowDecoration::~CHyprDropShadowDecoration() { - updateWindow(m_pWindow); -} +CHyprDropShadowDecoration::~CHyprDropShadowDecoration() {} eDecorationType CHyprDropShadowDecoration::getDecorationType() { return DECORATION_SHADOW; } SDecorationPositioningInfo CHyprDropShadowDecoration::getPositioningInfo() { - return {DECORATION_POSITION_ABSOLUTE}; + SDecorationPositioningInfo info; + info.policy = DECORATION_POSITION_ABSOLUTE; + info.desiredExtents = m_seExtents; + info.edges = DECORATION_EDGE_BOTTOM | DECORATION_EDGE_LEFT | DECORATION_EDGE_RIGHT | DECORATION_EDGE_TOP; + + m_seReportedExtents = m_seExtents; + return info; } void CHyprDropShadowDecoration::onPositioningReply(const SDecorationPositioningReply& reply) { @@ -148,8 +152,11 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a, const Vector2D } else { g_pHyprOpenGL->renderRoundedShadow(&fullBox, ROUNDING * pMonitor->scale, *PSHADOWSIZE * pMonitor->scale, a); } + + if (m_seExtents != m_seReportedExtents) + g_pDecorationPositioner->repositionDeco(this); } eDecorationLayer CHyprDropShadowDecoration::getDecorationLayer() { return DECORATION_LAYER_BOTTOM; -}
\ No newline at end of file +} |
