core: Move to hyprutils for Math

Moves CRegion, CBox and Vector2D over to hyprutils.

Requires hyprutils>=0.1.4
This commit is contained in:
Vaxry 2024-06-19 16:20:06 +02:00
parent 6e5804b53d
commit fb15b7aa2a
76 changed files with 509 additions and 1004 deletions

View file

@ -916,7 +916,7 @@ void CHyprOpenGLImpl::scissor(const CBox* pBox, bool transform) {
int w, h;
wlr_output_transformed_resolution(m_RenderData.pMonitor->output, &w, &h);
const auto TR = wlr_output_transform_invert(m_RenderData.pMonitor->transform);
const auto TR = wlTransformToHyprutils(wlr_output_transform_invert(m_RenderData.pMonitor->transform));
newBox.transform(TR, w, h);
}
@ -1006,8 +1006,8 @@ void CHyprOpenGLImpl::renderRectWithDamage(CBox* box, const CColor& col, CRegion
box = &newBox;
float matrix[9];
wlr_matrix_project_box(matrix, box->pWlr(), wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform), newBox.rot,
m_RenderData.monitorProjection.data()); // TODO: write own, don't use WLR here
projectBox(matrix, newBox, wlTransformToHyprutils(wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform)), newBox.rot,
m_RenderData.monitorProjection.data()); // TODO: write own, don't use WLR here
float glMatrix[9];
wlr_matrix_multiply(glMatrix, m_RenderData.projection, matrix);
@ -1025,7 +1025,7 @@ void CHyprOpenGLImpl::renderRectWithDamage(CBox* box, const CColor& col, CRegion
glUniform4f(m_RenderData.pCurrentMonData->m_shQUAD.color, col.r * col.a, col.g * col.a, col.b * col.a, col.a);
CBox transformedBox = *box;
transformedBox.transform(wlr_output_transform_invert(m_RenderData.pMonitor->transform), m_RenderData.pMonitor->vecTransformedSize.x,
transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(m_RenderData.pMonitor->transform)), m_RenderData.pMonitor->vecTransformedSize.x,
m_RenderData.pMonitor->vecTransformedSize.y);
const auto TOPLEFT = Vector2D(transformedBox.x, transformedBox.y);
@ -1097,9 +1097,9 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, CBox* pB
static auto PDT = CConfigValue<Hyprlang::INT>("debug:damage_tracking");
// get transform
const auto TRANSFORM = wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform);
const auto TRANSFORM = wlTransformToHyprutils(wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform));
float matrix[9];
wlr_matrix_project_box(matrix, newBox.pWlr(), TRANSFORM, newBox.rot, m_RenderData.monitorProjection.data());
projectBox(matrix, newBox, TRANSFORM, newBox.rot, m_RenderData.monitorProjection.data());
float glMatrix[9];
wlr_matrix_multiply(glMatrix, m_RenderData.projection, matrix);
@ -1185,7 +1185,7 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, CBox* pB
}
CBox transformedBox = newBox;
transformedBox.transform(wlr_output_transform_invert(m_RenderData.pMonitor->transform), m_RenderData.pMonitor->vecTransformedSize.x,
transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(m_RenderData.pMonitor->transform)), m_RenderData.pMonitor->vecTransformedSize.x,
m_RenderData.pMonitor->vecTransformedSize.y);
const auto TOPLEFT = Vector2D(transformedBox.x, transformedBox.y);
@ -1260,9 +1260,9 @@ void CHyprOpenGLImpl::renderTexturePrimitive(SP<CTexture> tex, CBox* pBox) {
m_RenderData.renderModif.applyToBox(newBox);
// get transform
const auto TRANSFORM = wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform);
const auto TRANSFORM = wlTransformToHyprutils(wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform));
float matrix[9];
wlr_matrix_project_box(matrix, newBox.pWlr(), TRANSFORM, newBox.rot, m_RenderData.monitorProjection.data());
projectBox(matrix, newBox, TRANSFORM, newBox.rot, m_RenderData.monitorProjection.data());
float glMatrix[9];
wlr_matrix_multiply(glMatrix, m_RenderData.projection, matrix);
@ -1314,9 +1314,9 @@ void CHyprOpenGLImpl::renderTextureMatte(SP<CTexture> tex, CBox* pBox, CFramebuf
m_RenderData.renderModif.applyToBox(newBox);
// get transform
const auto TRANSFORM = wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform);
const auto TRANSFORM = wlTransformToHyprutils(wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform));
float matrix[9];
wlr_matrix_project_box(matrix, newBox.pWlr(), TRANSFORM, newBox.rot, m_RenderData.monitorProjection.data());
projectBox(matrix, newBox, TRANSFORM, newBox.rot, m_RenderData.monitorProjection.data());
float glMatrix[9];
wlr_matrix_multiply(glMatrix, m_RenderData.projection, matrix);
@ -1372,10 +1372,10 @@ CFramebuffer* CHyprOpenGLImpl::blurMainFramebufferWithDamage(float a, CRegion* o
glDisable(GL_STENCIL_TEST);
// get transforms for the full monitor
const auto TRANSFORM = wlr_output_transform_invert(m_RenderData.pMonitor->transform);
const auto TRANSFORM = wlTransformToHyprutils(wlr_output_transform_invert(m_RenderData.pMonitor->transform));
float matrix[9];
CBox MONITORBOX = {0, 0, m_RenderData.pMonitor->vecTransformedSize.x, m_RenderData.pMonitor->vecTransformedSize.y};
wlr_matrix_project_box(matrix, MONITORBOX.pWlr(), TRANSFORM, 0, m_RenderData.monitorProjection.data());
projectBox(matrix, MONITORBOX, TRANSFORM, 0, m_RenderData.monitorProjection.data());
float glMatrix[9];
wlr_matrix_multiply(glMatrix, m_RenderData.projection, matrix);
@ -1870,8 +1870,8 @@ void CHyprOpenGLImpl::renderBorder(CBox* box, const CGradientValueData& grad, in
round += round == 0 ? 0 : scaledBorderSize;
float matrix[9];
wlr_matrix_project_box(matrix, box->pWlr(), wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform), newBox.rot,
m_RenderData.monitorProjection.data()); // TODO: write own, don't use WLR here
projectBox(matrix, newBox, wlTransformToHyprutils(wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform)), newBox.rot,
m_RenderData.monitorProjection.data()); // TODO: write own, don't use WLR here
float glMatrix[9];
wlr_matrix_multiply(glMatrix, m_RenderData.projection, matrix);
@ -1896,7 +1896,7 @@ void CHyprOpenGLImpl::renderBorder(CBox* box, const CGradientValueData& grad, in
glUniform1f(m_RenderData.pCurrentMonData->m_shBORDER1.alpha, a);
CBox transformedBox = *box;
transformedBox.transform(wlr_output_transform_invert(m_RenderData.pMonitor->transform), m_RenderData.pMonitor->vecTransformedSize.x,
transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(m_RenderData.pMonitor->transform)), m_RenderData.pMonitor->vecTransformedSize.x,
m_RenderData.pMonitor->vecTransformedSize.y);
const auto TOPLEFT = Vector2D(transformedBox.x, transformedBox.y);
@ -2176,8 +2176,8 @@ void CHyprOpenGLImpl::renderRoundedShadow(CBox* box, int round, int range, const
const auto col = color;
float matrix[9];
wlr_matrix_project_box(matrix, box->pWlr(), wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform), newBox.rot,
m_RenderData.monitorProjection.data()); // TODO: write own, don't use WLR here
projectBox(matrix, newBox, wlTransformToHyprutils(wlr_output_transform_invert(!m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : m_RenderData.pMonitor->transform)), newBox.rot,
m_RenderData.monitorProjection.data()); // TODO: write own, don't use WLR here
float glMatrix[9];
wlr_matrix_multiply(glMatrix, m_RenderData.projection, matrix);
@ -2258,7 +2258,7 @@ void CHyprOpenGLImpl::renderMirrored() {
CBox monbox = {0, 0, mirrored->vecTransformedSize.x * scale, mirrored->vecTransformedSize.y * scale};
// transform box as it will be drawn on a transformed projection
monbox.transform(mirrored->transform, mirrored->vecTransformedSize.x * scale, mirrored->vecTransformedSize.y * scale);
monbox.transform(wlTransformToHyprutils(mirrored->transform), mirrored->vecTransformedSize.x * scale, mirrored->vecTransformedSize.y * scale);
monbox.x = (monitor->vecTransformedSize.x - monbox.w) / 2;
monbox.y = (monitor->vecTransformedSize.y - monbox.h) / 2;

View file

@ -4,7 +4,7 @@
#include "../helpers/Monitor.hpp"
#include "../helpers/Color.hpp"
#include "../helpers/Timer.hpp"
#include "../helpers/Region.hpp"
#include "../helpers/math/Math.hpp"
#include "../helpers/Format.hpp"
#include <list>
#include <unordered_map>

View file

@ -1,6 +1,6 @@
#include "Renderer.hpp"
#include "../Compositor.hpp"
#include "../helpers/Region.hpp"
#include "../helpers/math/Math.hpp"
#include <algorithm>
#include "../config/ConfigValue.hpp"
#include "../managers/CursorManager.hpp"
@ -1508,15 +1508,15 @@ void CHyprRenderer::setWindowScanoutMode(PHLWINDOW pWindow) {
// taken from Sway.
// this is just too much of a spaghetti for me to understand
static void applyExclusive(wlr_box& usableArea, uint32_t anchor, int32_t exclusive, int32_t marginTop, int32_t marginRight, int32_t marginBottom, int32_t marginLeft) {
static void applyExclusive(CBox& usableArea, uint32_t anchor, int32_t exclusive, int32_t marginTop, int32_t marginRight, int32_t marginBottom, int32_t marginLeft) {
if (exclusive <= 0) {
return;
}
struct {
uint32_t singular_anchor;
uint32_t anchor_triplet;
int* positive_axis;
int* negative_axis;
double* positive_axis;
double* negative_axis;
int margin;
} edges[] = {
// Top
@ -1640,9 +1640,7 @@ void CHyprRenderer::arrangeLayerArray(CMonitor* pMonitor, const std::vector<PHLL
// Apply
ls->geometry = box;
applyExclusive(*usableArea->pWlr(), PSTATE->anchor, PSTATE->exclusive, PSTATE->margin.top, PSTATE->margin.right, PSTATE->margin.bottom, PSTATE->margin.left);
usableArea->applyFromWlr();
applyExclusive(*usableArea, PSTATE->anchor, PSTATE->exclusive, PSTATE->margin.top, PSTATE->margin.right, PSTATE->margin.bottom, PSTATE->margin.left);
if (Vector2D{box.width, box.height} != OLDSIZE)
ls->layerSurface->configure(box.size());
@ -1820,7 +1818,7 @@ void CHyprRenderer::damageMirrorsWith(CMonitor* pMonitor, const CRegion& pRegion
monbox.y = (monitor->vecTransformedSize.y - monbox.h) / 2;
wlr_region_scale(transformed.pixman(), transformed.pixman(), scale);
transformed.transform(mirrored->transform, mirrored->vecPixelSize.x * scale, mirrored->vecPixelSize.y * scale);
transformed.transform(wlTransformToHyprutils(mirrored->transform), mirrored->vecPixelSize.x * scale, mirrored->vecPixelSize.y * scale);
transformed.translate(Vector2D(monbox.x, monbox.y));
mirror->addDamage(&transformed);
@ -2234,7 +2232,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
if (pMonitor->createdByUser) {
CBox transformedBox = {0, 0, pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y};
transformedBox.transform(wlr_output_transform_invert(pMonitor->output->transform), pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y);
transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(pMonitor->output->transform)), pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y);
pMonitor->vecPixelSize = Vector2D(transformedBox.width, transformedBox.height);
}

View file

@ -6,7 +6,7 @@
#include "OpenGL.hpp"
#include "Renderbuffer.hpp"
#include "../helpers/Timer.hpp"
#include "../helpers/Region.hpp"
#include "../helpers/math/Math.hpp"
struct SMonitorRule;
class CWorkspace;

View file

@ -55,7 +55,7 @@ CTexture::CTexture(wlr_texture* tex) {
else
m_iType = TEXTURE_EXTERNAL;
m_vSize = Vector2D(tex->width, tex->height);
m_vSize = Vector2D((int)tex->width, (int)tex->height);
}
CTexture::CTexture(const SDMABUFAttrs& attrs, void* image) {

View file

@ -4,7 +4,7 @@
class IWLBuffer;
struct SDMABUFAttrs;
class CRegion;
HYPRUTILS_FORWARD(Math, CRegion);
enum TEXTURETYPE {
TEXTURE_INVALID, // Invalid

View file

@ -26,16 +26,16 @@ class CHyprBorderDecoration : public IHyprWindowDecoration {
virtual std::string getDisplayName();
private:
SWindowDecorationExtents m_seExtents;
SWindowDecorationExtents m_seReportedExtents;
SBoxExtents m_seExtents;
SBoxExtents m_seReportedExtents;
PHLWINDOWREF m_pWindow;
PHLWINDOWREF m_pWindow;
Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;
Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;
CBox m_bAssignedGeometry = {0};
CBox m_bAssignedGeometry = {0};
CBox assignedBoxGlobal();
bool doesntWantBorders();
CBox assignedBoxGlobal();
bool doesntWantBorders();
};

View file

@ -130,7 +130,7 @@ void CHyprDropShadowDecoration::draw(CMonitor* pMonitor, float a) {
const float SHADOWSCALE = std::clamp(*PSHADOWSCALE, 0.f, 1.f);
// scale the box in relation to the center of the box
fullBox.scaleFromCenter(SHADOWSCALE).translate(*PSHADOWOFFSET);
fullBox.scaleFromCenter(SHADOWSCALE).translate({(*PSHADOWOFFSET).x, (*PSHADOWOFFSET).y});
updateWindow(PWINDOW);
m_vLastWindowPos += WORKSPACEOFFSET;

View file

@ -26,14 +26,14 @@ class CHyprDropShadowDecoration : public IHyprWindowDecoration {
virtual std::string getDisplayName();
private:
SWindowDecorationExtents m_seExtents;
SWindowDecorationExtents m_seReportedExtents;
SBoxExtents m_seExtents;
SBoxExtents m_seReportedExtents;
PHLWINDOWREF m_pWindow;
PHLWINDOWREF m_pWindow;
Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;
Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;
CBox m_bLastWindowBox = {0};
CBox m_bLastWindowBoxWithDecos = {0};
CBox m_bLastWindowBox = {0};
CBox m_bLastWindowBoxWithDecos = {0};
};

View file

@ -48,7 +48,7 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration {
virtual std::string getDisplayName();
private:
SWindowDecorationExtents m_seExtents;
SBoxExtents m_seExtents;
CBox m_bAssignedBox = {0};

View file

@ -33,11 +33,11 @@ Vector2D CDecorationPositioner::getEdgeDefinedPoint(uint32_t edges, PHLWINDOW pW
if (EDGESNO == 1) {
if (TOP)
return wb.pos() + Vector2D{wb.size().x / 2.0, 0};
return wb.pos() + Vector2D{wb.size().x / 2.0, 0.0};
else if (BOTTOM)
return wb.pos() + Vector2D{wb.size().x / 2.0, wb.size().y};
else if (LEFT)
return wb.pos() + Vector2D{0, wb.size().y / 2.0};
return wb.pos() + Vector2D{0.0, wb.size().y / 2.0};
else if (RIGHT)
return wb.pos() + Vector2D{wb.size().x, wb.size().y / 2.0};
UNREACHABLE();
@ -45,11 +45,11 @@ Vector2D CDecorationPositioner::getEdgeDefinedPoint(uint32_t edges, PHLWINDOW pW
if (TOP && LEFT)
return wb.pos();
if (TOP && RIGHT)
return wb.pos() + Vector2D{wb.size().x, 0};
return wb.pos() + Vector2D{wb.size().x, 0.0};
if (BOTTOM && RIGHT)
return wb.pos() + wb.size();
if (BOTTOM && LEFT)
return wb.pos() + Vector2D{0, wb.size().y};
return wb.pos() + Vector2D{0.0, wb.size().y};
UNREACHABLE();
}
UNREACHABLE();
@ -234,26 +234,26 @@ void CDecorationPositioner::onWindowUpdate(PHLWINDOW pWindow) {
} else if (LEFT) {
pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, -stickyOffsetYT};
pos.x -= desiredSize;
size = {desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
size = {(double)desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
if (SOLID)
stickyOffsetXL += desiredSize;
} else if (RIGHT) {
pos = wb.pos() + Vector2D{wb.size().x, 0} - EDGEPOINT + Vector2D{stickyOffsetXR, -stickyOffsetYT};
size = {desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
pos = wb.pos() + Vector2D{wb.size().x, 0.0} - EDGEPOINT + Vector2D{stickyOffsetXR, -stickyOffsetYT};
size = {(double)desiredSize, wb.size().y + stickyOffsetYB + stickyOffsetYT};
if (SOLID)
stickyOffsetXR += desiredSize;
} else if (TOP) {
pos = wb.pos() - EDGEPOINT - Vector2D{stickyOffsetXL, stickyOffsetYT};
pos.y -= desiredSize;
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, desiredSize};
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, (double)desiredSize};
if (SOLID)
stickyOffsetYT += desiredSize;
} else {
pos = wb.pos() + Vector2D{0, wb.size().y} - EDGEPOINT - Vector2D{stickyOffsetXL, stickyOffsetYB};
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, desiredSize};
pos = wb.pos() + Vector2D{0.0, wb.size().y} - EDGEPOINT - Vector2D{stickyOffsetXL, stickyOffsetYB};
size = {wb.size().x + stickyOffsetXL + stickyOffsetXR, (double)desiredSize};
if (SOLID)
stickyOffsetYB += desiredSize;
@ -271,7 +271,7 @@ void CDecorationPositioner::onWindowUpdate(PHLWINDOW pWindow) {
}
}
if (WINDOWDATA->extents != SWindowDecorationExtents{{stickyOffsetXL + reservedXL, stickyOffsetYT + reservedYT}, {stickyOffsetXR + reservedXR, stickyOffsetYB + reservedYB}}) {
if (WINDOWDATA->extents != SBoxExtents{{stickyOffsetXL + reservedXL, stickyOffsetYT + reservedYT}, {stickyOffsetXR + reservedXR, stickyOffsetYB + reservedYB}}) {
WINDOWDATA->extents = {{stickyOffsetXL + reservedXL, stickyOffsetYT + reservedYT}, {stickyOffsetXR + reservedXR, stickyOffsetYB + reservedYB}};
g_pLayoutManager->getCurrentLayout()->recalculateWindow(pWindow);
}
@ -286,14 +286,14 @@ void CDecorationPositioner::onWindowMap(PHLWINDOW pWindow) {
m_mWindowDatas[pWindow] = {};
}
SWindowDecorationExtents CDecorationPositioner::getWindowDecorationReserved(PHLWINDOW pWindow) {
SBoxExtents CDecorationPositioner::getWindowDecorationReserved(PHLWINDOW pWindow) {
try {
const auto E = m_mWindowDatas.at(pWindow);
return E.reserved;
} catch (std::out_of_range& e) { return {}; }
}
SWindowDecorationExtents CDecorationPositioner::getWindowDecorationExtents(PHLWINDOW pWindow, bool inputOnly) {
SBoxExtents CDecorationPositioner::getWindowDecorationExtents(PHLWINDOW pWindow, bool inputOnly) {
CBox accum = pWindow->getWindowMainSurfaceBox();
for (auto& data : m_vWindowPositioningDatas) {
@ -317,7 +317,7 @@ SWindowDecorationExtents CDecorationPositioner::getWindowDecorationExtents(PHLWI
decoBox.translate(EDGEPOINT);
}
SWindowDecorationExtents extentsToAdd;
SBoxExtents extentsToAdd;
if (decoBox.x < accum.x)
extentsToAdd.topLeft.x = accum.x - decoBox.x;
@ -355,7 +355,7 @@ CBox CDecorationPositioner::getBoxWithIncludedDecos(PHLWINDOW pWindow) {
decoBox.translate(EDGEPOINT);
}
SWindowDecorationExtents extentsToAdd;
SBoxExtents extentsToAdd;
if (decoBox.x < accum.x)
extentsToAdd.topLeft.x = accum.x - decoBox.x;

View file

@ -3,7 +3,7 @@
#include <cstdint>
#include <vector>
#include <map>
#include "../../helpers/Box.hpp"
#include "../../helpers/math/Math.hpp"
#include "../../desktop/DesktopTypes.hpp"
class CWindow;
@ -37,7 +37,7 @@ struct SDecorationPositioningInfo {
eDecorationPositioningPolicy policy = DECORATION_POSITION_ABSOLUTE;
uint32_t edges = 0; // enum eDecorationEdges
uint32_t priority = 10; // priority, decos will be evaluated high -> low
SWindowDecorationExtents desiredExtents;
SBoxExtents desiredExtents;
bool reserved = false; // if true, geometry will use reserved area
};
@ -62,14 +62,14 @@ class CDecorationPositioner {
Vector2D getEdgeDefinedPoint(uint32_t edges, PHLWINDOW pWindow);
// called on resize, or insert/removal of a new deco
void onWindowUpdate(PHLWINDOW pWindow);
void uncacheDecoration(IHyprWindowDecoration* deco);
SWindowDecorationExtents getWindowDecorationReserved(PHLWINDOW pWindow);
SWindowDecorationExtents getWindowDecorationExtents(PHLWINDOW pWindow, bool inputOnly = false);
CBox getBoxWithIncludedDecos(PHLWINDOW pWindow);
void repositionDeco(IHyprWindowDecoration* deco);
CBox getWindowDecorationBox(IHyprWindowDecoration* deco);
void forceRecalcFor(PHLWINDOW pWindow);
void onWindowUpdate(PHLWINDOW pWindow);
void uncacheDecoration(IHyprWindowDecoration* deco);
SBoxExtents getWindowDecorationReserved(PHLWINDOW pWindow);
SBoxExtents getWindowDecorationExtents(PHLWINDOW pWindow, bool inputOnly = false);
CBox getBoxWithIncludedDecos(PHLWINDOW pWindow);
void repositionDeco(IHyprWindowDecoration* deco);
CBox getWindowDecorationBox(IHyprWindowDecoration* deco);
void forceRecalcFor(PHLWINDOW pWindow);
private:
struct SWindowPositioningData {
@ -81,10 +81,10 @@ class CDecorationPositioner {
};
struct SWindowData {
Vector2D lastWindowSize = {};
SWindowDecorationExtents reserved = {};
SWindowDecorationExtents extents = {};
bool needsRecalc = false;
Vector2D lastWindowSize = {};
SBoxExtents reserved = {};
SBoxExtents extents = {};
bool needsRecalc = false;
};
std::map<PHLWINDOWREF, SWindowData> m_mWindowDatas;

View file

@ -2,7 +2,7 @@
#include <any>
#include "../../defines.hpp"
#include "../../helpers/Region.hpp"
#include "../../helpers/math/Math.hpp"
#include "DecorationPositioner.hpp"
enum eDecorationType {