all: chase hyprland

This commit is contained in:
Vaxry 2024-07-21 13:40:40 +02:00
parent f23d3ebd92
commit 1ce5b7a046
5 changed files with 8 additions and 10 deletions

View file

@ -80,7 +80,7 @@ void CHyprBar::onMouseDown(SCallbackInfo& info, IPointer::SButtonEvent e) {
return;
}
if (e.state != WLR_BUTTON_PRESSED) {
if (!e.state != WL_POINTER_BUTTON_STATE_PRESSED) {
if (m_bCancelledDown)
info.cancelled = true;

View file

@ -110,7 +110,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
for (size_t i = 0; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
COverview::SWorkspaceImage& image = images[i];
image.fb.alloc(monbox.w, monbox.h, PMONITOR->drmFormat);
image.fb.alloc(monbox.w, monbox.h, PMONITOR->output->state->state().drmFormat);
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
g_pHyprRenderer->beginRender(PMONITOR, fakeDamage, RENDER_MODE_FULL_FAKE, nullptr, &image.fb);
@ -238,7 +238,7 @@ void COverview::redrawID(int id, bool forcelowres) {
if (image.fb.m_vSize != monbox.size()) {
image.fb.release();
image.fb.m_pStencilTex = nullptr;
image.fb.alloc(monbox.w, monbox.h, pMonitor->drmFormat);
image.fb.alloc(monbox.w, monbox.h, pMonitor->output->state->state().drmFormat);
}
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};

View file

@ -81,8 +81,7 @@ int onTick(void* data) {
}
void initGlobal() {
RASSERT(eglMakeCurrent(wlr_egl_get_display(g_pCompositor->m_sWLREGL), EGL_NO_SURFACE, EGL_NO_SURFACE, wlr_egl_get_context(g_pCompositor->m_sWLREGL)),
"Couldn't set current EGL!");
g_pHyprRenderer->makeEGLCurrent();
GLuint prog = CreateProgram(QUADTRAIL, FRAGTRAIL);
g_pGlobalState->trailShader.program = prog;
@ -93,8 +92,6 @@ void initGlobal() {
g_pGlobalState->trailShader.posAttrib = glGetAttribLocation(prog, "pos");
g_pGlobalState->trailShader.gradient = glGetUniformLocation(prog, "snapshots");
RASSERT(eglMakeCurrent(wlr_egl_get_display(g_pCompositor->m_sWLREGL), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT), "Couldn't unset current EGL!");
g_pGlobalState->tick = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, &onTick, nullptr);
wl_event_source_timer_update(g_pGlobalState->tick, 1);
}

View file

@ -120,11 +120,11 @@ 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};
float matrix[9];
projectBox(matrix, monbox, wlTransformToHyprutils(wlr_output_transform_invert(WL_OUTPUT_TRANSFORM_NORMAL)), 0,
projectBox(matrix, monbox, wlTransformToHyprutils(invertTransform(WL_OUTPUT_TRANSFORM_NORMAL)), 0,
g_pHyprOpenGL->m_RenderData.pMonitor->projMatrix.data()); // TODO: write own, don't use WLR here
float glMatrix[9];
wlr_matrix_multiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix);
matrixMultiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix);
g_pHyprOpenGL->blend(true);
@ -249,7 +249,7 @@ void CTrail::draw(CMonitor* pMonitor, float a) {
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
CBox transformedBox = monbox;
transformedBox.transform(wlTransformToHyprutils(wlr_output_transform_invert(g_pHyprOpenGL->m_RenderData.pMonitor->transform)),
transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_RenderData.pMonitor->transform)),
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());

View file

@ -5,6 +5,7 @@
#include <hyprland/src/includes.hpp>
#include <any>
#include <sstream>
#define private public
#include <hyprland/src/Compositor.hpp>