mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 13:05:59 +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,14 +1345,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
|
|
||||||
if (renderCursor) {
|
if (renderCursor) {
|
||||||
TRACY_GPU_ZONE("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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1356,6 +1352,9 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
|
|
||||||
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