platforms/drm: fix hidden cursor

BUG: 438824
This commit is contained in:
Xaver Hugl 2021-09-23 13:36:13 +02:00
parent 966a95e5fd
commit 416f55cea3

View file

@ -345,9 +345,9 @@ bool DrmPipeline::moveCursor(QPoint pos)
return true;
}
if (drmModeMoveCursor(m_gpu->fd(), m_crtc->id(), pos.x(), pos.y()) != 0) {
m_cursor.pos = pos;
return false;
}
m_cursor.pos = pos;
m_cursor.dirtyPos = false;
return true;
}
@ -359,6 +359,8 @@ bool DrmPipeline::setActive(bool active)
if (drmModeSetCursor(m_gpu->fd(), m_crtc->id(), 0, 0, 0) != 0) {
qCWarning(KWIN_DRM) << "Could not set cursor:" << strerror(errno);
}
m_cursor.dirtyBo = true;
m_cursor.dirtyPos = true;
}
bool success = false;
auto mode = m_connector->currentMode().mode;
@ -386,6 +388,7 @@ bool DrmPipeline::setActive(bool active)
if (isActive()) {
// enable cursor (again)
setCursor(m_cursor.buffer, m_cursor.hotspot);
moveCursor(m_cursor.pos);
}
return success;
}