From a44ab7748f07ae87f944513d01685a7456c44ee0 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:51:07 +0100 Subject: renderer: optimize render pipeline when there is a solitary client --- src/helpers/SubsurfaceTree.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/helpers/SubsurfaceTree.cpp') diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp index 5b86f928..0efa4c49 100644 --- a/src/helpers/SubsurfaceTree.cpp +++ b/src/helpers/SubsurfaceTree.cpp @@ -250,8 +250,14 @@ void Events::listener_commitSubsurface(void* owner, void* data) { // tearing: if solitary, redraw it. This still might be a single surface window const auto PMONITOR = g_pCompositor->getMonitorFromID(pNode->pWindowOwner->m_iMonitorID); if (PMONITOR->solitaryClient == pNode->pWindowOwner && pNode->pWindowOwner->canBeTorn() && PMONITOR->canTear) { - PMONITOR->nextRenderTorn = true; - g_pHyprRenderer->renderMonitor(PMONITOR); + + CRegion damageBox; + wlr_surface_get_effective_damage(pNode->pSurface->wlr(), damageBox.pixman()); + + if (!damageBox.empty()) { + PMONITOR->nextRenderTorn = true; + g_pHyprRenderer->renderMonitor(PMONITOR); + } } } } -- cgit v1.2.3