mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 09:49:50 +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;
|
||||
}
|
||||
|
||||
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()) {
|
||||
|
|
Loading…
Reference in a new issue