summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-07-30 15:50:14 +0200
committerVaxry <vaxry@vaxry.net>2024-07-30 15:50:14 +0200
commitcc7c117fe76ff0a4da56b18026c725501de92c84 (patch)
tree068d7a4895e4e6df3f6b3e3c9732c6fd42f504c0 /src
parent1c221240d0c6c352cea203b51a918b906a8d340f (diff)
output: minor tearing fixes
Diffstat (limited to 'src')
-rw-r--r--src/helpers/Monitor.cpp3
-rw-r--r--src/render/Renderer.cpp7
2 files changed, 4 insertions, 6 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 787b790f..33fe0c04 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -812,7 +812,8 @@ bool CMonitor::attemptDirectScanout() {
// and comes from the appropriate device. This may implode on multi-gpu!!
output->state->setBuffer(PSURFACE->current.buffer);
- output->state->setPresentationMode(Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_VSYNC);
+ output->state->setPresentationMode(tearingState.activelyTearing ? Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_IMMEDIATE :
+ Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_VSYNC);
if (!state.test())
return false;
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index df0c6af5..b5397598 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1193,6 +1193,8 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
shouldTear = true;
}
+ pMonitor->tearingState.activelyTearing = shouldTear;
+
if (!*PNODIRECTSCANOUT && !shouldTear) {
if (pMonitor->attemptDirectScanout()) {
return;
@@ -1202,11 +1204,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
}
}
- if (pMonitor->tearingState.activelyTearing != shouldTear) {
- // change of state
- pMonitor->tearingState.activelyTearing = shouldTear;
- }
-
EMIT_HOOK_EVENT("preRender", pMonitor);
timespec now;