mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-25 03:35:59 +01:00
all: chase hyprland
This commit is contained in:
parent
f23d3ebd92
commit
1ce5b7a046
5 changed files with 8 additions and 10 deletions
|
@ -80,7 +80,7 @@ void CHyprBar::onMouseDown(SCallbackInfo& info, IPointer::SButtonEvent e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.state != WLR_BUTTON_PRESSED) {
|
if (!e.state != WL_POINTER_BUTTON_STATE_PRESSED) {
|
||||||
|
|
||||||
if (m_bCancelledDown)
|
if (m_bCancelledDown)
|
||||||
info.cancelled = true;
|
info.cancelled = true;
|
||||||
|
|
|
@ -110,7 +110,7 @@ COverview::COverview(PHLWORKSPACE startedOn_, bool swipe_) : startedOn(startedOn
|
||||||
|
|
||||||
for (size_t i = 0; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
for (size_t i = 0; i < SIDE_LENGTH * SIDE_LENGTH; ++i) {
|
||||||
COverview::SWorkspaceImage& image = images[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};
|
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
|
||||||
g_pHyprRenderer->beginRender(PMONITOR, fakeDamage, RENDER_MODE_FULL_FAKE, nullptr, &image.fb);
|
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()) {
|
if (image.fb.m_vSize != monbox.size()) {
|
||||||
image.fb.release();
|
image.fb.release();
|
||||||
image.fb.m_pStencilTex = nullptr;
|
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};
|
CRegion fakeDamage{0, 0, INT16_MAX, INT16_MAX};
|
||||||
|
|
|
@ -81,8 +81,7 @@ int onTick(void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initGlobal() {
|
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)),
|
g_pHyprRenderer->makeEGLCurrent();
|
||||||
"Couldn't set current EGL!");
|
|
||||||
|
|
||||||
GLuint prog = CreateProgram(QUADTRAIL, FRAGTRAIL);
|
GLuint prog = CreateProgram(QUADTRAIL, FRAGTRAIL);
|
||||||
g_pGlobalState->trailShader.program = prog;
|
g_pGlobalState->trailShader.program = prog;
|
||||||
|
@ -93,8 +92,6 @@ void initGlobal() {
|
||||||
g_pGlobalState->trailShader.posAttrib = glGetAttribLocation(prog, "pos");
|
g_pGlobalState->trailShader.posAttrib = glGetAttribLocation(prog, "pos");
|
||||||
g_pGlobalState->trailShader.gradient = glGetUniformLocation(prog, "snapshots");
|
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);
|
g_pGlobalState->tick = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, &onTick, nullptr);
|
||||||
wl_event_source_timer_update(g_pGlobalState->tick, 1);
|
wl_event_source_timer_update(g_pGlobalState->tick, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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};
|
CBox monbox = {0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecTransformedSize.y};
|
||||||
|
|
||||||
float matrix[9];
|
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
|
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);
|
matrixMultiply(glMatrix, g_pHyprOpenGL->m_RenderData.projection, matrix);
|
||||||
|
|
||||||
g_pHyprOpenGL->blend(true);
|
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);
|
glUniform4f(g_pGlobalState->trailShader.color, COLOR.r, COLOR.g, COLOR.b, COLOR.a);
|
||||||
|
|
||||||
CBox transformedBox = monbox;
|
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);
|
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());
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <hyprland/src/includes.hpp>
|
#include <hyprland/src/includes.hpp>
|
||||||
#include <any>
|
#include <any>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#define private public
|
#define private public
|
||||||
#include <hyprland/src/Compositor.hpp>
|
#include <hyprland/src/Compositor.hpp>
|
||||||
|
|
Loading…
Reference in a new issue