diff --git a/src/helpers/WLSurface.cpp b/src/helpers/WLSurface.cpp index 99771d0d..2aa36267 100644 --- a/src/helpers/WLSurface.cpp +++ b/src/helpers/WLSurface.cpp @@ -57,10 +57,10 @@ CRegion CWLSurface::logicalDamage() const { damage.transform(m_pWLRSurface->current.transform, m_pWLRSurface->current.buffer_width, m_pWLRSurface->current.buffer_height); damage.scale(1.0 / m_pWLRSurface->current.scale); - const auto VPSIZE = getViewporterCorrectedSize() / m_pWLRSurface->current.scale; + const auto VPSIZE = getViewporterCorrectedSize(); const auto CORRECTVEC = correctSmallVec(); - damage.scale({VPSIZE.x / m_pWLRSurface->current.width, VPSIZE.y / m_pWLRSurface->current.height}); + damage.scale({VPSIZE.x / m_pWLRSurface->current.buffer_width, VPSIZE.y / m_pWLRSurface->current.buffer_height}); damage.translate(CORRECTVEC); return damage; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 7b40f646..adc25c56 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1588,10 +1588,12 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y, dou y += CORRECTION.y; } - const auto WLSURF = CWLSurface::surfaceFromWlr(pSurface); - if (!WLSURF) + const auto WLSURF = CWLSurface::surfaceFromWlr(pSurface); + CRegion damageBox = WLSURF ? WLSURF->logicalDamage() : CRegion{}; + if (!WLSURF) { Debug::log(ERR, "BUG THIS: No CWLSurface for surface in damageSurface!!!"); - CRegion damageBox = WLSURF ? WLSURF->logicalDamage() : CRegion{&pSurface->buffer_damage}; + wlr_surface_get_effective_damage(pSurface, damageBox.pixman()); + } if (scale != 1.0) damageBox.scale(scale);