aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-05-10 23:38:46 +0100
committerVaxry <[email protected]>2024-05-10 23:38:46 +0100
commit19186de11834df43494378478d2d3a374e2409ae (patch)
tree4b37e88e9b582e0c35451fa7f89b943c848e2a51
parent38911d6df4977b6b00557cc887eb151d032e505b (diff)
downloadHyprland-19186de11834df43494378478d2d3a374e2409ae.tar.gz
Hyprland-19186de11834df43494378478d2d3a374e2409ae.zip
renderer: avoid locking during rendering
it can trigger pointermgr to render which fucks up our pass fixes #5998
-rw-r--r--src/render/Renderer.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index d02ed4e2..2574a015 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1247,6 +1247,10 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
pMonitor->forceFullFrames = 10;
}
+ bool lockSoftware = pMonitor == g_pCompositor->getMonitorFromCursor() && *PZOOMFACTOR != 1.f;
+ if (lockSoftware)
+ g_pPointerManager->lockSoftwareForMonitor(pMonitor->self.lock());
+
CRegion damage, finalDamage;
if (!beginRender(pMonitor, damage, RENDER_MODE_NORMAL)) {
Debug::log(ERR, "renderer: couldn't beginRender()!");
@@ -1341,21 +1345,16 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
if (renderCursor) {
TRACY_GPU_ZONE("RenderCursor");
-
- bool lockSoftware = pMonitor == g_pCompositor->getMonitorFromCursor() && *PZOOMFACTOR != 1.f;
-
- if (lockSoftware) {
- g_pPointerManager->lockSoftwareForMonitor(pMonitor->self.lock());
- g_pPointerManager->renderSoftwareCursorsFor(pMonitor->self.lock(), &now, g_pHyprOpenGL->m_RenderData.damage);
- g_pPointerManager->unlockSoftwareForMonitor(pMonitor->self.lock());
- } else
- g_pPointerManager->renderSoftwareCursorsFor(pMonitor->self.lock(), &now, g_pHyprOpenGL->m_RenderData.damage);
+ g_pPointerManager->renderSoftwareCursorsFor(pMonitor->self.lock(), &now, g_pHyprOpenGL->m_RenderData.damage);
}
EMIT_HOOK_EVENT("render", RENDER_LAST_MOMENT);
endRender();
+ if (lockSoftware)
+ g_pPointerManager->unlockSoftwareForMonitor(pMonitor->self.lock());
+
TRACY_GPU_COLLECT;
if (!pMonitor->mirrors.empty()) {