mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 18:45:59 +01:00
renderer: avoid spamming software cursor locks
This commit is contained in:
parent
772c7d1d3c
commit
e2b72b2975
1 changed files with 8 additions and 2 deletions
|
@ -884,7 +884,14 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pMonitor->activelyTearing = shouldTear;
|
if (pMonitor->activelyTearing != shouldTear) {
|
||||||
|
// change of state
|
||||||
|
pMonitor->activelyTearing = shouldTear;
|
||||||
|
|
||||||
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
wlr_output_lock_software_cursors(m->output, pMonitor->activelyTearing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EMIT_HOOK_EVENT("preRender", pMonitor);
|
EMIT_HOOK_EVENT("preRender", pMonitor);
|
||||||
|
|
||||||
|
@ -1025,7 +1032,6 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
TRACY_GPU_ZONE("RenderCursor");
|
TRACY_GPU_ZONE("RenderCursor");
|
||||||
|
|
||||||
bool lockSoftware = pMonitor == g_pCompositor->getMonitorFromCursor() && *PZOOMFACTOR != 1.f;
|
bool lockSoftware = pMonitor == g_pCompositor->getMonitorFromCursor() && *PZOOMFACTOR != 1.f;
|
||||||
lockSoftware = lockSoftware || std::ranges::any_of(g_pCompositor->m_vMonitors, [](const auto& m) { return m->activelyTearing; });
|
|
||||||
|
|
||||||
if (lockSoftware) {
|
if (lockSoftware) {
|
||||||
wlr_output_lock_software_cursors(pMonitor->output, true);
|
wlr_output_lock_software_cursors(pMonitor->output, true);
|
||||||
|
|
Loading…
Reference in a new issue