summaryrefslogtreecommitdiff
path: root/src/helpers/SubsurfaceTree.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-09-30 17:07:50 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-09-30 17:07:50 +0100
commita2a29a60e5301df2cadf58c1bb18495d02710547 (patch)
tree3733a017de47a82b3c654e960f39ce61982f5781 /src/helpers/SubsurfaceTree.cpp
parente2b72b2975782719759b989853578db95671b069 (diff)
tearing: cleanup vars and avoid rendering before drm is ready
Diffstat (limited to 'src/helpers/SubsurfaceTree.cpp')
-rw-r--r--src/helpers/SubsurfaceTree.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp
index 0efa4c49..76a392e8 100644
--- a/src/helpers/SubsurfaceTree.cpp
+++ b/src/helpers/SubsurfaceTree.cpp
@@ -249,14 +249,19 @@ void Events::listener_commitSubsurface(void* owner, void* data) {
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) {
+ if (PMONITOR->solitaryClient == pNode->pWindowOwner && pNode->pWindowOwner->canBeTorn() && PMONITOR->tearingState.canTear) {
CRegion damageBox;
wlr_surface_get_effective_damage(pNode->pSurface->wlr(), damageBox.pixman());
if (!damageBox.empty()) {
- PMONITOR->nextRenderTorn = true;
- g_pHyprRenderer->renderMonitor(PMONITOR);
+
+ if (PMONITOR->tearingState.busy) {
+ PMONITOR->tearingState.frameScheduledWhileBusy = true;
+ } else {
+ PMONITOR->tearingState.nextRenderTorn = true;
+ g_pHyprRenderer->renderMonitor(PMONITOR);
+ }
}
}
}