diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2023-09-28 21:48:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-28 21:48:33 +0100 |
| commit | 88b63a00b68350d6d001445357a2582ab5975f9c (patch) | |
| tree | a730d59c70e5987eae8006fd5b0eb4ef531113dc /src/helpers/SubsurfaceTree.cpp | |
| parent | 1e513e25d5645260a2ebdfbe8dbf3b8df487339c (diff) | |
renderer: Tearing implementation (#3441)
Diffstat (limited to 'src/helpers/SubsurfaceTree.cpp')
| -rw-r--r-- | src/helpers/SubsurfaceTree.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp index 5e3e9e67..5b86f928 100644 --- a/src/helpers/SubsurfaceTree.cpp +++ b/src/helpers/SubsurfaceTree.cpp @@ -245,6 +245,15 @@ void Events::listener_commitSubsurface(void* owner, void* data) { if (pNode->pSurface && pNode->pSurface->exists()) g_pHyprRenderer->damageSurface(pNode->pSurface->wlr(), lx, ly, SCALE); + + if (pNode->pWindowOwner) { + // 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); + } + } } void Events::listener_destroySubsurface(void* owner, void* data) { |
