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>
This commit is contained in:
MightyPlaza 2023-09-06 18:16:04 +01:00
parent cc26620121
commit 4ed0cd74d1
No known key found for this signature in database
GPG key ID: 284C27FD27A6DC0D
2 changed files with 12 additions and 0 deletions

View file

@ -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;
}

View file

@ -33,6 +33,8 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration {
virtual SWindowDecorationExtents getWindowDecorationReservedArea();
virtual CRegion getWindowDecorationRegion();
virtual void forceReload(CWindow*);
virtual bool allowsInput();