From 7ce451d20c33025d4aaaf55444150c4a875b83ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20V=2E=20Farias?= <51831435+BeyondMagic@users.noreply.github.com> Date: Thu, 25 Sep 2025 16:14:04 -0300 Subject: [PATCH] renderer: disable anti-aliasing on cursor:zoom_factor (#6135) (#11828) use nearest-neighbor filtering for cursor scaling to avoid blurriness --- src/render/OpenGL.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 3cb810e1..e1ecdd2f 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -1760,6 +1760,16 @@ void CHyprOpenGLImpl::renderTexturePrimitive(SP tex, const CBox& box) glActiveTexture(GL_TEXTURE0); tex->bind(); + // ensure the final blit uses the desired sampling filter + // when cursor zoom is active we want nearest-neighbor (no anti-aliasing) + if (m_renderData.useNearestNeighbor) { + tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_NEAREST); + tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_NEAREST); + } else { + tex->setTexParameter(GL_TEXTURE_MAG_FILTER, GL_LINEAR); + tex->setTexParameter(GL_TEXTURE_MIN_FILTER, GL_LINEAR); + } + useProgram(shader->program); shader->setUniformMatrix3fv(SHADER_PROJ, 1, GL_TRUE, glMatrix.getMatrix()); shader->setUniformInt(SHADER_TEX, 0);