mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 08:05:58 +01:00
renderer: lock software cursors while tearing
This commit is contained in:
parent
86e8ed038f
commit
b8f8912db2
2 changed files with 4 additions and 0 deletions
|
@ -87,6 +87,7 @@ class CMonitor {
|
|||
bool nextRenderTorn = false;
|
||||
bool ignoreNextFlipEvent = false;
|
||||
bool renderingFromVblankEvent = false;
|
||||
bool activelyTearing = false;
|
||||
|
||||
// for the special workspace. 0 means not open.
|
||||
int specialWorkspaceID = 0;
|
||||
|
|
|
@ -884,6 +884,8 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
|||
}
|
||||
}
|
||||
|
||||
pMonitor->activelyTearing = shouldTear;
|
||||
|
||||
EMIT_HOOK_EVENT("preRender", pMonitor);
|
||||
|
||||
timespec now;
|
||||
|
@ -1023,6 +1025,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
|||
TRACY_GPU_ZONE("RenderCursor");
|
||||
|
||||
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) {
|
||||
wlr_output_lock_software_cursors(pMonitor->output, true);
|
||||
|
|
Loading…
Reference in a new issue