backends/drm: Fix stuck cursors

Currently, if you move the cursor really fast between two outputs, there
may be stuck cursor on the previous output.

We need to query the old cursor visibility status before updating the
cursor position, otherwise the drm backend may not schedule an update to
move the cursor offscreen.
This commit is contained in:
Vlad Zahorodnii 2021-12-09 21:28:00 +02:00
parent f51ad0897f
commit eb080395ef

View file

@ -344,9 +344,9 @@ bool DrmPipeline::moveCursor(QPoint pos)
if (pending.cursorPos == pos) {
return true;
}
pending.cursorPos = pos;
bool result;
const bool visibleBefore = isCursorVisible();
bool result;
pending.cursorPos = pos;
// explicitly check for the cursor plane and not for AMS, as we might not always have one
if (pending.crtc->cursorPlane()) {
result = commitPipelines({this}, CommitMode::Test);