hyprtrails,borders-plus-plus: chase hyprland

This commit is contained in:
Mihai Fufezan 2024-06-23 22:21:21 +03:00
parent db46f6acb3
commit 61656eb7d6
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
3 changed files with 14 additions and 14 deletions

View file

@ -28,14 +28,14 @@ class CBordersPlusPlus : public IHyprWindowDecoration {
virtual std::string getDisplayName(); virtual std::string getDisplayName();
private: private:
SWindowDecorationExtents m_seExtents; SBoxExtents m_seExtents;
PHLWINDOWREF m_pWindow; PHLWINDOWREF m_pWindow;
CBox m_bLastRelativeBox; CBox m_bLastRelativeBox;
Vector2D m_vLastWindowPos; Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize; Vector2D m_vLastWindowSize;
double m_fLastThickness = 0; double m_fLastThickness = 0;
}; };

View file

@ -120,8 +120,8 @@ void CTrail::draw(CMonitor* pMonitor, float a) {
CBox monbox = {0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y}; CBox monbox = {0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y};
float matrix[9]; float matrix[9];
wlr_matrix_project_box(matrix, monbox.pWlr(), wlr_output_transform_invert(WL_OUTPUT_TRANSFORM_NORMAL), 0, projectBox(matrix, monbox, wlTransformToHyprutils(wlr_output_transform_invert(WL_OUTPUT_TRANSFORM_NORMAL)), 0,
g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix.data()); // TODO: write own, don't use WLR here g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix.data()); // TODO: write own, don't use WLR here
float glMatrix[9]; float glMatrix[9];
wlr_matrix_multiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix); wlr_matrix_multiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix);
@ -249,8 +249,8 @@ void CTrail::draw(CMonitor* pMonitor, float a) {
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a); glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
CBox transformedBox = monbox; CBox transformedBox = monbox;
transformedBox.transform(wlr_output_transform_invert(g_pHyprOpenGL->m_RenderData.pMonitor->transform), g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(g_pHyprOpenGL->m_RenderData.pMonitor->transform)),
g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y); g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y);
glVertexAttribPointer(g_pGlobalState->trailShader.posAttrib, 2, GL_FLOAT, GL_FALSE, 0, (float*)points.data()); glVertexAttribPointer(g_pGlobalState->trailShader.posAttrib, 2, GL_FLOAT, GL_FALSE, 0, (float*)points.data());
@ -334,4 +334,4 @@ void CTrail::damageEntire() {
CBox dm = {(int)(m_vLastWindowPos.x - m_seExtents.topLeft.x), (int)(m_vLastWindowPos.y - m_seExtents.topLeft.y), CBox dm = {(int)(m_vLastWindowPos.x - m_seExtents.topLeft.x), (int)(m_vLastWindowPos.y - m_seExtents.topLeft.y),
(int)(m_vLastWindowSize.x + m_seExtents.topLeft.x + m_seExtents.bottomRight.x), (int)m_seExtents.topLeft.y}; (int)(m_vLastWindowSize.x + m_seExtents.topLeft.x + m_seExtents.bottomRight.x), (int)m_seExtents.topLeft.y};
g_pHyprRenderer->damageBox(&dm); g_pHyprRenderer->damageBox(&dm);
} }

View file

@ -53,7 +53,7 @@ class CTrail : public IHyprWindowDecoration {
int m_iTimer = 0; int m_iTimer = 0;
SWindowDecorationExtents m_seExtents; SBoxExtents m_seExtents;
PHLWINDOWREF m_pWindow; PHLWINDOWREF m_pWindow;
@ -62,4 +62,4 @@ class CTrail : public IHyprWindowDecoration {
CBox m_bLastBox = {0}; CBox m_bLastBox = {0};
bool m_bNeedsDamage = false; bool m_bNeedsDamage = false;
}; };