summaryrefslogtreecommitdiff
path: root/src/render/Renderer.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/render/Renderer.cpp
parente2b72b2975782719759b989853578db95671b069 (diff)
tearing: cleanup vars and avoid rendering before drm is ready
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index ea6a246a..12b745ff 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -846,10 +846,9 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
// tearing and DS first
bool shouldTear = false;
- bool canTear = *PTEARINGENABLED && g_pHyprOpenGL->m_RenderData.mouseZoomFactor == 1.0;
recheckSolitaryForMonitor(pMonitor);
- if (pMonitor->nextRenderTorn) {
- pMonitor->nextRenderTorn = false;
+ if (pMonitor->tearingState.nextRenderTorn) {
+ pMonitor->tearingState.nextRenderTorn = false;
if (!*PTEARINGENABLED) {
Debug::log(WARN, "Tearing commit requested but the master switch general:allow_tearing is off, ignoring");
@@ -861,18 +860,13 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
return;
}
- if (!pMonitor->canTear) {
+ if (!pMonitor->tearingState.canTear) {
Debug::log(WARN, "Tearing commit requested but monitor doesn't support it, ignoring");
return;
}
if (pMonitor->solitaryClient)
shouldTear = true;
- } else {
- // if this is a non-tearing commit, and we are in a state where we should tear
- // then this is a vblank commit that we should ignore
- if (canTear && pMonitor->solitaryClient && pMonitor->canTear && pMonitor->solitaryClient->canBeTorn() && pMonitor->renderingFromVblankEvent)
- return;
}
if (!*PNODIRECTSCANOUT && !shouldTear) {
@@ -884,12 +878,12 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
}
}
- if (pMonitor->activelyTearing != shouldTear) {
+ if (pMonitor->tearingState.activelyTearing != shouldTear) {
// change of state
- pMonitor->activelyTearing = shouldTear;
+ pMonitor->tearingState.activelyTearing = shouldTear;
for (auto& m : g_pCompositor->m_vMonitors) {
- wlr_output_lock_software_cursors(m->output, pMonitor->activelyTearing);
+ wlr_output_lock_software_cursors(m->output, pMonitor->tearingState.activelyTearing);
}
}
@@ -1090,7 +1084,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
}
if (shouldTear)
- pMonitor->ignoreNextFlipEvent = true;
+ pMonitor->tearingState.busy = true;
wlr_damage_ring_rotate(&pMonitor->damage);