mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 23:21:57 -07:00
pointer: don't update hw cursors on disabled displays
This commit is contained in:
@@ -309,6 +309,11 @@ void CPointerManager::resetCursorImage(bool apply) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
for (auto& ms : monitorStates) {
|
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->cursorFrontBuffer) {
|
||||||
if (ms->monitor->output->impl->set_cursor)
|
if (ms->monitor->output->impl->set_cursor)
|
||||||
ms->monitor->output->impl->set_cursor(ms->monitor->output, nullptr, 0, 0);
|
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) {
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
auto state = stateFor(m);
|
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)) {
|
if (state->softwareLocks > 0 || *PNOHW || !attemptHardwareCursor(state)) {
|
||||||
Debug::log(TRACE, "Output {} rejected hardware cursors, falling back to sw", m->szName);
|
Debug::log(TRACE, "Output {} rejected hardware cursors, falling back to sw", m->szName);
|
||||||
state->box = getCursorBoxLogicalForMonitor(state->monitor.lock());
|
state->box = getCursorBoxLogicalForMonitor(state->monitor.lock());
|
||||||
|
Reference in New Issue
Block a user