renderer: Tearing implementation (#3441)

This commit is contained in:
Vaxry
2023-09-28 21:48:33 +01:00
committed by GitHub
parent 1e513e25d5
commit 88b63a00b6
19 changed files with 231 additions and 61 deletions

View File

@@ -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) {