mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 05:10:20 +01:00
Fix VRR with software cursors and no_break_fs_vrr=1
This commit is contained in:
parent
466690dc89
commit
c73e8c1317
2 changed files with 12 additions and 7 deletions
|
|
@ -738,16 +738,21 @@ Vector2D CPointerManager::closestValid(const Vector2D& pos) {
|
|||
}
|
||||
|
||||
void CPointerManager::damageIfSoftware() {
|
||||
if (g_pCompositor->m_unsafeState)
|
||||
return;
|
||||
|
||||
auto b = getCursorBoxGlobal().expand(4);
|
||||
|
||||
for (auto const& mw : m_monitorStates) {
|
||||
if (mw->monitor.expired() || !mw->monitor->m_output)
|
||||
auto monitor = mw->monitor;
|
||||
if (monitor.expired() || !monitor->m_output || monitor->isMirror())
|
||||
continue;
|
||||
|
||||
if ((mw->softwareLocks > 0 || mw->hardwareFailed || g_pConfigManager->shouldUseSoftwareCursors(mw->monitor.lock())) &&
|
||||
b.overlaps({mw->monitor->m_position, mw->monitor->m_size})) {
|
||||
g_pHyprRenderer->damageBox(b, mw->monitor->shouldSkipScheduleFrameOnMouseEvent());
|
||||
break;
|
||||
b.overlaps({mw->monitor->m_position, mw->monitor->m_size}) && !mw->monitor->shouldSkipScheduleFrameOnMouseEvent()) {
|
||||
|
||||
CBox damageBox = b.copy().translate(-monitor->m_position).scale(monitor->m_scale).round();
|
||||
mw->monitor->addDamage(damageBox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1915,15 +1915,15 @@ void CHyprRenderer::damageSurface(SP<CWLSurfaceResource> pSurface, double x, dou
|
|||
return;
|
||||
}
|
||||
|
||||
if (damageBox.empty())
|
||||
return;
|
||||
|
||||
if (scale != 1.0)
|
||||
damageBox.scale(scale);
|
||||
|
||||
// schedule frame events
|
||||
g_pCompositor->scheduleFrameForMonitor(g_pCompositor->getMonitorFromVector(Vector2D(x, y)), Aquamarine::IOutput::AQ_SCHEDULE_DAMAGE);
|
||||
|
||||
if (damageBox.empty())
|
||||
return;
|
||||
|
||||
damageBox.translate({x, y});
|
||||
|
||||
CRegion damageBoxForEach;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue