From ca4b68e42538cb38234152ea3fc7e63363844e13 Mon Sep 17 00:00:00 2001 From: bea4dev <34712108+bea4dev@users.noreply.github.com> Date: Fri, 7 Nov 2025 04:18:16 +0900 Subject: [PATCH] renderer: fix fractional scale artifact (#12219) --- src/render/Renderer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 14ed1469..8bb50c38 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1137,13 +1137,11 @@ void CHyprRenderer::calculateUVForSurface(PHLWINDOW pWindow, SPm_current.bufferSize - projSize; if (MISALIGNMENT != Vector2D{}) uvBR -= MISALIGNMENT * PIXELASUV; - } - - // if the surface is smaller than our viewport, extend its edges. - // this will break if later on xdg geometry is hit, but we really try - // to let the apps know to NOT add CSD. Also if source is there. - // there is no way to fix this if that's the case - { + } else { + // if the surface is smaller than our viewport, extend its edges. + // this will break if later on xdg geometry is hit, but we really try + // to let the apps know to NOT add CSD. Also if source is there. + // there is no way to fix this if that's the case const auto MONITOR_WL_SCALE = std::ceil(pMonitor->m_scale); const bool SCALE_UNAWARE = MONITOR_WL_SCALE > 1 && (MONITOR_WL_SCALE == pSurface->m_current.scale || !pSurface->m_current.viewport.hasDestination); const auto EXPECTED_SIZE = getSurfaceExpectedSize(pWindow, pSurface, pMonitor, main).value_or((projSize * pMonitor->m_scale).round());