From b2df11bf7e59d57240afcdf88b352d49799d9922 Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Wed, 20 May 2020 19:56:15 +0530 Subject: [PATCH] [platforms/drm] show cursor only when it is enabled In previous code we used to update/show cursor even when the pointer device was present, e.g mobile device. Guard it behind the cursor enabled check. BUG: 418977 FIXED-IN: 5.19.0 --- plugins/platforms/drm/drm_backend.h | 4 ++++ plugins/platforms/drm/drm_output.cpp | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/platforms/drm/drm_backend.h b/plugins/platforms/drm/drm_backend.h index 545865187f..93333279a6 100644 --- a/plugins/platforms/drm/drm_backend.h +++ b/plugins/platforms/drm/drm_backend.h @@ -132,6 +132,10 @@ public: QString supportInformation() const override; + bool isCursorEnabled() const { + return m_cursorEnabled; + }; + public Q_SLOTS: void turnOutputsOn(); diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp index 0d3ee97788..66ffbe06aa 100644 --- a/plugins/platforms/drm/drm_output.cpp +++ b/plugins/platforms/drm/drm_output.cpp @@ -709,9 +709,12 @@ void DrmOutput::updateTransform(Transform transform) } m_modesetRequested = true; - // the cursor might need to get rotated - updateCursor(); - showCursor(); + // show cursor only if is enabled, i.e if pointer device is presentP + if (m_backend->isCursorEnabled()) { + // the cursor might need to get rotated + updateCursor(); + showCursor(); + } } void DrmOutput::updateMode(int modeIndex) @@ -867,9 +870,11 @@ bool DrmOutput::presentAtomically(DrmBuffer *buffer) m_primaryPlane->setTransformation(m_lastWorkingState.planeTransformations); } m_modesetRequested = true; - // the cursor might need to get rotated - updateCursor(); - showCursor(); + if (m_backend->isCursorEnabled()) { + // the cursor might need to get rotated + updateCursor(); + showCursor(); + } // TODO: forward to OutputInterface and OutputDeviceInterface setWaylandMode(); emit screens()->changed();