diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-29 17:51:07 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-09-29 17:51:07 +0100 |
| commit | a44ab7748f07ae87f944513d01685a7456c44ee0 (patch) | |
| tree | 8e77df734dc79c1b74abee3faf8cd5c4a18c8d4c /src/helpers/SubsurfaceTree.cpp | |
| parent | ab11bd20851c5bb99f0e164ee5b0ebe3888628c0 (diff) | |
renderer: optimize render pipeline when there is a solitary client
Diffstat (limited to 'src/helpers/SubsurfaceTree.cpp')
| -rw-r--r-- | src/helpers/SubsurfaceTree.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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); + } } } } |
