From 4ed0cd74d1d1c786a9c61b3e1609c7fbd7774766 Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Wed, 6 Sep 2023 18:16:04 +0100 Subject: [PATCH] add custom getWindowDecorationRegion for groupbar modified: src/render/decorations/CHyprGroupBarDecoration.cpp modified: src/render/decorations/CHyprGroupBarDecoration.hpp Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> --- src/render/decorations/CHyprGroupBarDecoration.cpp | 10 ++++++++++ src/render/decorations/CHyprGroupBarDecoration.hpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 9d6e76ec..d86f9b76 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -363,6 +363,16 @@ void CHyprGroupBarDecoration::forceReload(CWindow* pWindow) { refreshGradients(); } +CRegion CHyprGroupBarDecoration::getWindowDecorationRegion() { + const int ROUNDING = !m_pWindow->m_sSpecialRenderData.rounding ? 0 : m_pWindow->rounding(); + const int BORDERSIZE = m_pWindow->getRealBorderSize(); + return CRegion(m_vLastWindowPos.x + ROUNDING, + m_vLastWindowPos.y + + (m_bOnTop ? -BAR_INTERNAL_PADDING - m_iBarInternalHeight - (m_bInternalBorder ? 0 : BORDERSIZE) : + m_vLastWindowSize.y + BAR_INTERNAL_PADDING + (m_bInternalBorder ? 0 : BORDERSIZE)), + m_vLastWindowSize.x - 2 * ROUNDING, m_iBarInternalHeight); +} + bool CHyprGroupBarDecoration::allowsInput() { return true; } diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index 1d999cac..49d20e7a 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 CRegion getWindowDecorationRegion(); + virtual void forceReload(CWindow*); virtual bool allowsInput();