mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 07:50:03 +01:00
Fix locks and clean up CPointerManager::damageIfSoftware
This commit is contained in:
parent
ee471d11cd
commit
1198f83d8f
1 changed files with 11 additions and 7 deletions
|
|
@ -744,16 +744,20 @@ void CPointerManager::damageIfSoftware() {
|
||||||
auto b = getCursorBoxGlobal().expand(4);
|
auto b = getCursorBoxGlobal().expand(4);
|
||||||
|
|
||||||
for (auto const& mw : m_monitorStates) {
|
for (auto const& mw : m_monitorStates) {
|
||||||
auto monitor = mw->monitor;
|
auto monitor = mw->monitor.lock();
|
||||||
if (monitor.expired() || !monitor->m_output || monitor->isMirror())
|
if (!monitor || !monitor->m_output || monitor->isMirror())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((mw->softwareLocks > 0 || mw->hardwareFailed || g_pConfigManager->shouldUseSoftwareCursors(mw->monitor.lock())) &&
|
auto usesSoftwareCursor = (mw->softwareLocks > 0 || mw->hardwareFailed || g_pConfigManager->shouldUseSoftwareCursors(monitor));
|
||||||
b.overlaps({mw->monitor->m_position, mw->monitor->m_size}) && !mw->monitor->shouldSkipScheduleFrameOnMouseEvent()) {
|
if (!usesSoftwareCursor)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
auto shouldAddDamage = !monitor->shouldSkipScheduleFrameOnMouseEvent() && b.overlaps({monitor->m_position, monitor->m_size});
|
||||||
|
if (!shouldAddDamage)
|
||||||
|
continue;
|
||||||
|
|
||||||
CBox damageBox = b.copy().translate(-monitor->m_position).scale(monitor->m_scale).round();
|
CBox damageBox = b.copy().translate(-monitor->m_position).scale(monitor->m_scale).round();
|
||||||
mw->monitor->addDamage(damageBox);
|
monitor->addDamage(damageBox);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue