summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorq234rty <q23456yuiop@gmail.com>2024-01-02 03:20:27 +0800
committerGitHub <noreply@github.com>2024-01-01 20:20:27 +0100
commit1a4f23eb2fee77b23b2cc6ff1fbfc87f60f10314 (patch)
tree1882781d8a900ab02b269ddb712cf74f8ac0d1af /src/render
parent42ab06e7c84fed39b3f853f213ef2966f23baaa5 (diff)
renderer: Only force nearest neighbor when the sizes are off by one or two (#4325)
Fixes rendering issues in arch's extra/telegram-desktop
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Renderer.cpp1
1 files changed, 1 insertions, 0 deletions
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;