mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 16:05:58 +01:00
renderer: avoid locking during rendering
it can trigger pointermgr to render which fucks up our pass fixes #5998
This commit is contained in:
parent
38911d6df4
commit
19186de118
1 changed files with 8 additions and 9 deletions
|
@ -1247,6 +1247,10 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
pMonitor->forceFullFrames = 10;
|
pMonitor->forceFullFrames = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool lockSoftware = pMonitor == g_pCompositor->getMonitorFromCursor() && *PZOOMFACTOR != 1.f;
|
||||||
|
if (lockSoftware)
|
||||||
|
g_pPointerManager->lockSoftwareForMonitor(pMonitor->self.lock());
|
||||||
|
|
||||||
CRegion damage, finalDamage;
|
CRegion damage, finalDamage;
|
||||||
if (!beginRender(pMonitor, damage, RENDER_MODE_NORMAL)) {
|
if (!beginRender(pMonitor, damage, RENDER_MODE_NORMAL)) {
|
||||||
Debug::log(ERR, "renderer: couldn't beginRender()!");
|
Debug::log(ERR, "renderer: couldn't beginRender()!");
|
||||||
|
@ -1341,21 +1345,16 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
|
|
||||||
if (renderCursor) {
|
if (renderCursor) {
|
||||||
TRACY_GPU_ZONE("RenderCursor");
|
TRACY_GPU_ZONE("RenderCursor");
|
||||||
|
g_pPointerManager->renderSoftwareCursorsFor(pMonitor->self.lock(), &now, g_pHyprOpenGL->m_RenderData.damage);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EMIT_HOOK_EVENT("render", RENDER_LAST_MOMENT);
|
EMIT_HOOK_EVENT("render", RENDER_LAST_MOMENT);
|
||||||
|
|
||||||
endRender();
|
endRender();
|
||||||
|
|
||||||
|
if (lockSoftware)
|
||||||
|
g_pPointerManager->unlockSoftwareForMonitor(pMonitor->self.lock());
|
||||||
|
|
||||||
TRACY_GPU_COLLECT;
|
TRACY_GPU_COLLECT;
|
||||||
|
|
||||||
if (!pMonitor->mirrors.empty()) {
|
if (!pMonitor->mirrors.empty()) {
|
||||||
|
|
Loading…
Reference in a new issue