pointer: don't update hw cursors on disabled displays

This commit is contained in:
Vaxry 2024-05-16 19:34:36 +01:00
parent a2643e11a0
commit abbe71d26d

View file

@ -309,6 +309,11 @@ void CPointerManager::resetCursorImage(bool apply) {
return;
for (auto& ms : monitorStates) {
if (!ms->monitor || !ms->monitor->m_bEnabled || !ms->monitor->dpmsStatus) {
Debug::log(TRACE, "Not updating hw cursors: disabled / dpms off display");
continue;
}
if (ms->cursorFrontBuffer) {
if (ms->monitor->output->impl->set_cursor)
ms->monitor->output->impl->set_cursor(ms->monitor->output, nullptr, 0, 0);
@ -324,6 +329,11 @@ void CPointerManager::updateCursorBackend() {
for (auto& m : g_pCompositor->m_vMonitors) {
auto state = stateFor(m);
if (!m->m_bEnabled || !m->dpmsStatus) {
Debug::log(TRACE, "Not updating hw cursors: disabled / dpms off display");
continue;
}
if (state->softwareLocks > 0 || *PNOHW || !attemptHardwareCursor(state)) {
Debug::log(TRACE, "Output {} rejected hardware cursors, falling back to sw", m->szName);
state->box = getCursorBoxLogicalForMonitor(state->monitor.lock());