diff options
Diffstat (limited to 'src/render')
5 files changed, 35 insertions, 5 deletions
diff --git a/src/render/decorations/CHyprDropShadowDecoration.cpp b/src/render/decorations/CHyprDropShadowDecoration.cpp index 15f993c9..ee1a65a5 100644 --- a/src/render/decorations/CHyprDropShadowDecoration.cpp +++ b/src/render/decorations/CHyprDropShadowDecoration.cpp @@ -2,7 +2,7 @@ #include "../../Compositor.hpp" -CHyprDropShadowDecoration::CHyprDropShadowDecoration(CWindow* pWindow) { +CHyprDropShadowDecoration::CHyprDropShadowDecoration(CWindow* pWindow) : IHyprWindowDecoration(pWindow) { m_pWindow = pWindow; } diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 2414357e..89e047ca 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -7,7 +7,7 @@ static CTexture m_tGradientActive; static CTexture m_tGradientInactive; -CHyprGroupBarDecoration::CHyprGroupBarDecoration(CWindow* pWindow) { +CHyprGroupBarDecoration::CHyprGroupBarDecoration(CWindow* pWindow) : IHyprWindowDecoration(pWindow) { m_pWindow = pWindow; } @@ -306,3 +306,7 @@ void CHyprGroupBarDecoration::refreshGradients() { renderGradientTo(m_tGradientActive, ((CGradientValueData*)PCOLACTIVE->get())->m_vColors[0]); renderGradientTo(m_tGradientInactive, ((CGradientValueData*)PCOLINACTIVE->get())->m_vColors[0]); } + +bool CHyprGroupBarDecoration::allowsInput() { + return true; +} diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index ac6d103f..118c7a64 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.hpp +++ b/src/render/decorations/CHyprGroupBarDecoration.hpp @@ -33,6 +33,8 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration { virtual SWindowDecorationExtents getWindowDecorationReservedArea(); + virtual bool allowsInput(); + private: SWindowDecorationExtents m_seExtents; @@ -52,4 +54,4 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration { // STitleTexs* overriden = nullptr; // TODO: make shit shared in-group to decrease VRAM usage. std::deque<std::unique_ptr<CTitleTex>> titleTexs; } m_sTitleTexs; -};
\ No newline at end of file +}; diff --git a/src/render/decorations/IHyprWindowDecoration.cpp b/src/render/decorations/IHyprWindowDecoration.cpp index 3ad5591f..a87c334a 100644 --- a/src/render/decorations/IHyprWindowDecoration.cpp +++ b/src/render/decorations/IHyprWindowDecoration.cpp @@ -2,12 +2,29 @@ #include "../../Window.hpp" +IHyprWindowDecoration::IHyprWindowDecoration(CWindow* pWindow) { + m_pWindow = pWindow; +} + IHyprWindowDecoration::~IHyprWindowDecoration() {} SWindowDecorationExtents IHyprWindowDecoration::getWindowDecorationReservedArea() { return SWindowDecorationExtents{}; } +CRegion IHyprWindowDecoration::getWindowDecorationRegion() { + const SWindowDecorationExtents RESERVED = getWindowDecorationReservedArea(); + const int BORDERSIZE = m_pWindow->getRealBorderSize(); + return CRegion(m_pWindow->m_vRealPosition.vec().x - (BORDERSIZE + RESERVED.topLeft.x) * (int)(RESERVED.topLeft.x != 0), + m_pWindow->m_vRealPosition.vec().y - (BORDERSIZE + RESERVED.topLeft.y) * (int)(RESERVED.topLeft.y != 0), + m_pWindow->m_vRealSize.vec().x + (BORDERSIZE + RESERVED.topLeft.x) * (int)(RESERVED.topLeft.x != 0) + + (BORDERSIZE + RESERVED.bottomRight.x) * (int)(RESERVED.bottomRight.x != 0), + m_pWindow->m_vRealSize.vec().y + (BORDERSIZE + RESERVED.topLeft.y) * (int)(RESERVED.topLeft.y != 0) + + (BORDERSIZE + RESERVED.bottomRight.y) * (int)(RESERVED.bottomRight.y != 0)) + .subtract(CRegion(m_pWindow->m_vRealPosition.vec().x - BORDERSIZE, m_pWindow->m_vRealPosition.vec().y - BORDERSIZE, m_pWindow->m_vRealSize.vec().x + 2 * BORDERSIZE, + m_pWindow->m_vRealSize.vec().y + 2 * BORDERSIZE)); +} + bool IHyprWindowDecoration::allowsInput() { return false; -}
\ No newline at end of file +} diff --git a/src/render/decorations/IHyprWindowDecoration.hpp b/src/render/decorations/IHyprWindowDecoration.hpp index e5eb1bb9..fec7305d 100644 --- a/src/render/decorations/IHyprWindowDecoration.hpp +++ b/src/render/decorations/IHyprWindowDecoration.hpp @@ -1,6 +1,7 @@ #pragma once #include "../../defines.hpp" +#include "../../helpers/Region.hpp" enum eDecorationType { DECORATION_NONE = -1, @@ -19,6 +20,7 @@ class CMonitor; class IHyprWindowDecoration { public: + IHyprWindowDecoration(CWindow*); virtual ~IHyprWindowDecoration() = 0; virtual SWindowDecorationExtents getWindowDecorationExtents() = 0; @@ -33,5 +35,10 @@ class IHyprWindowDecoration { virtual SWindowDecorationExtents getWindowDecorationReservedArea(); + virtual CRegion getWindowDecorationRegion(); + virtual bool allowsInput(); -};
\ No newline at end of file + + private: + CWindow* m_pWindow = nullptr; +}; |
