backends/drm: set cursor again after it was hidden

This isn't necessary with atomic modesetting, as moving and setting are
the same thing. With legacy though, if the cursor was hidden, moving it
with the layer visible does not automatically show it again, so that needs
to be done explicitly

BUG: 461181
This commit is contained in:
Xaver Hugl 2023-02-09 20:42:45 +01:00
parent 1b75d4b71a
commit 815269a26f

View file

@ -217,11 +217,12 @@ bool DrmOutput::moveCursor(const QPoint &position)
const QSize layerSize = m_gpu->cursorSize() / scale();
const QRect layerRect = monitorMatrix.mapRect(QRect(m_cursor.position, layerSize));
const auto layer = m_pipeline->cursorLayer();
const bool wasVisible = layer->isVisible();
layer->setVisible(true);
layer->setPosition(layerRect.topLeft());
m_moveCursorSuccessful = m_pipeline->moveCursor();
layer->setVisible(m_moveCursorSuccessful);
if (!m_moveCursorSuccessful) {
if (!m_moveCursorSuccessful || !wasVisible) {
m_pipeline->setCursor();
}
return m_moveCursorSuccessful;