From abbe71d26dd0299071e7a86a287c49d7fb185677 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 16 May 2024 19:34:36 +0100 Subject: [PATCH] pointer: don't update hw cursors on disabled displays --- src/managers/PointerManager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index 6a0fb984..d565ad6d 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -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());