From 815269a26f234758f95a729c2323de552723639b Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 9 Feb 2023 20:42:45 +0100 Subject: [PATCH] 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 --- src/backends/drm/drm_output.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index f21318db4e..867ea6b8a2 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -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;