drm: we must not call showCursor when softwareCursor is on

Otherwise we'll show a dangling cursor but otherwise the cursor will be
updated by other code paths, so we end up with a weird cursor in the
middle of the screen that doesn't move.
This commit is contained in:
Aleix Pol 2020-07-26 20:43:39 +02:00 committed by Aleix Pol Gonzalez
parent 9225848fb0
commit edb6159396

View file

@ -120,6 +120,11 @@ bool DrmOutput::showCursor(DrmDumbBuffer *c)
bool DrmOutput::showCursor() bool DrmOutput::showCursor()
{ {
if (Q_UNLIKELY(m_backend->usesSoftwareCursor())) {
qCCritical(KWIN_DRM) << "DrmOutput::showCursor should never be called when software cursor is enabled";
return true;
}
const bool ret = showCursor(m_cursor[m_cursorIndex]); const bool ret = showCursor(m_cursor[m_cursorIndex]);
if (!ret) { if (!ret) {
return ret; return ret;
@ -710,7 +715,7 @@ void DrmOutput::updateTransform(Transform transform)
m_modesetRequested = true; m_modesetRequested = true;
// show cursor only if is enabled, i.e if pointer device is presentP // show cursor only if is enabled, i.e if pointer device is presentP
if (m_backend->isCursorEnabled()) { if (m_backend->isCursorEnabled() && !m_backend->usesSoftwareCursor()) {
// the cursor might need to get rotated // the cursor might need to get rotated
updateCursor(); updateCursor();
showCursor(); showCursor();