mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-20 07:30:05 +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);
|
||||
|
||||
for (auto const& mw : m_monitorStates) {
|
||||
auto monitor = mw->monitor;
|
||||
if (monitor.expired() || !monitor->m_output || monitor->isMirror())
|
||||
auto monitor = mw->monitor.lock();
|
||||
if (!monitor || !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}) && !mw->monitor->shouldSkipScheduleFrameOnMouseEvent()) {
|
||||
auto usesSoftwareCursor = (mw->softwareLocks > 0 || mw->hardwareFailed || g_pConfigManager->shouldUseSoftwareCursors(monitor));
|
||||
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();
|
||||
mw->monitor->addDamage(damageBox);
|
||||
}
|
||||
monitor->addDamage(damageBox);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue