2022-05-28 20:46:20 +02:00
|
|
|
#include "IHyprWindowDecoration.hpp"
|
|
|
|
|
|
|
|
#include "../../Window.hpp"
|
|
|
|
|
2023-08-30 17:39:22 +02:00
|
|
|
IHyprWindowDecoration::IHyprWindowDecoration(CWindow* pWindow) {
|
|
|
|
m_pWindow = pWindow;
|
|
|
|
}
|
|
|
|
|
2022-12-16 18:17:31 +01:00
|
|
|
IHyprWindowDecoration::~IHyprWindowDecoration() {}
|
2023-02-28 20:36:36 +01:00
|
|
|
|
|
|
|
SWindowDecorationExtents IHyprWindowDecoration::getWindowDecorationReservedArea() {
|
|
|
|
return SWindowDecorationExtents{};
|
|
|
|
}
|
2023-02-28 23:32:42 +01:00
|
|
|
|
2023-08-30 17:39:22 +02:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2023-02-28 23:32:42 +01:00
|
|
|
bool IHyprWindowDecoration::allowsInput() {
|
|
|
|
return false;
|
2023-08-30 17:39:22 +02:00
|
|
|
}
|