From 1a4f23eb2fee77b23b2cc6ff1fbfc87f60f10314 Mon Sep 17 00:00:00 2001 From: q234rty Date: Tue, 2 Jan 2024 03:20:27 +0800 Subject: [PATCH] renderer: Only force nearest neighbor when the sizes are off by one or two (#4325) Fixes rendering issues in arch's extra/telegram-desktop --- src/render/Renderer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 0416d08f..533215ce 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -118,6 +118,7 @@ static void renderSurface(struct wlr_surface* surface, int x, int y, void* data) const auto NEARESTNEIGHBORSET = g_pHyprOpenGL->m_RenderData.useNearestNeighbor; if (std::floor(RDATA->pMonitor->scale) != RDATA->pMonitor->scale /* Fractional */ && surface->current.scale == 1 /* fs protocol */ && windowBox.size() != Vector2D{surface->current.buffer_width, surface->current.buffer_height} /* misaligned */ && + DELTALESSTHAN(windowBox.width, surface->current.buffer_width, 3) && DELTALESSTHAN(windowBox.height, surface->current.buffer_height, 3) /* off by one-or-two */ && (!RDATA->pWindow || (!RDATA->pWindow->m_vRealSize.isBeingAnimated() && !INTERACTIVERESIZEINPROGRESS)) /* not window or not animated/resizing */) g_pHyprOpenGL->m_RenderData.useNearestNeighbor = true;